Why does my PHP not recognize $_POST but $_REQUEST still works

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Freedom Coach
    New Member
    • Jan 2012
    • 3

    Why does my PHP not recognize $_POST but $_REQUEST still works

    I am an old school (mainframe) programmer trying to learn the new web technology. I was having a terrible time trying to get PHP to process a parameter passed from a form. It is apparently supposed to be automatic, but it didn't work for me.
    When I changed the method to GET instead of POST on my INPUT HTML it started sending the data in the URL. I changed the method back to POST but the parameters are still being transmitted using an extended URL. When I finally figured out how to get the information to PHP from the $_POST array (THANKS TO THIS WEBSITE!) I had to change to $_REQUEST for it to work. I really don't want to generate a new URL every time the form gets used.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    I changed the method back to POST but the parameters are still being transmitted using an extended URL.
    are you sure you are using the POST method? if you have the data in the URL, it is definitely GET. and if it’s GET then $_POST won’t be populated.

    the HTML should look somewhat like <form action="process .php" method="post">

    Comment

    • Freedom Coach
      New Member
      • Jan 2012
      • 3

      #3
      It appears that I did not SAVE the change back to method="post". Sorry about the false alarm.

      Comment

      Working...