Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SOLVED POST doesn't work but GET does

Discussion in 'General Discussion' started by val98, May 23, 2018.

  1. val98

    val98 Member

    Joined:
    May 21, 2018
    Messages:
    6
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    PA
    cPanel Access Level:
    Website Owner
    I have a form and when I use POST to get the fields for use in another file, var_dump($_POST); is empty. Now if I change all occurrences of 'POST' to 'GET' everything works as it's supposed to and var_dump($_GET); returns the correct information. Why does POST not work and how can I fix this?
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,961
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @val98,

    This type of question is better suited for a website such as StackOverflow where coding discussions occur. If you're concerned it's related to an Apache configuration setting, check cPanel >> Errors when this happens to see if you notice any specific output:

    Errors - Version 70 Documentation - cPanel Documentation

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. val98

    val98 Member

    Joined:
    May 21, 2018
    Messages:
    6
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    PA
    cPanel Access Level:
    Website Owner




    Hi,
    I checked on StackOverflow and my code is fine. Several users copy and pasted my code and said it works for them, so this is an issue with cPanel. I tried contacting support and they didn't know what to do, they tried some stuff but nothing changed. Do you know what could be wrong with my settings that stops $_POST from working but allows $_GET to work fine?
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,961
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @val98,

    Do you notice any output in cPanel >> Errors or in the error_log file within the document root of the script when observing this behavior?

    Also, do you have any rewrite rules added to the .htaccess file in the document root of the script, or in the public_html directory itself? If so, see if the issue persists upon temporarily disabling those rules.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    val98 likes this.
  5. val98

    val98 Member

    Joined:
    May 21, 2018
    Messages:
    6
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    PA
    cPanel Access Level:
    Website Owner



    THANK YOU!!!!!
    One of the lines in my htaccess was causing the problem. Thanks for your help!
     
    cPanelMichael likes this.
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,961
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @val98,

    I'm happy to see the issue is now solved. Thank you for sharing the outcome.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice