Results 1 to 3 of 3

Thread: php POST not working

  1. #1
    familytreemaker is offline Junior Member
    Join Date
    May 2021
    Posts
    2

    Default php POST not working

    I have this

    PHP Code:
    $userID = $_POST['id'];
    in a php file.

    The $userID is in an echo and empty when sending a POST http request using axios.
    Not sure if I am doing something wrong or if something on the site needs to be set to enable POST php.

    Other php code for get is working.

    Thank you,
    Michel

  2. #2
    alemoppo is offline AlterVista Staff
    Join Date
    Feb 2010
    Location
    IT
    Posts
    692

    Default

    Probably the request is wrong. Did you try with a simple HTML form?
    HTML Code:
    <form action="your_page.php" method="POST">
    <input type="text" name="id">
    <input type="submit">
    </form>
    Bye!

  3. #3
    familytreemaker is offline Junior Member
    Join Date
    May 2021
    Posts
    2

    Default

    That works. I see the id. Thank you!
    Now I know it is something wrong with the axios post request.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

SEO by vBSEO