passing variables values using POST

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • runway27
    Banned
    New Member
    • Sep 2007
    • 54

    #1

    passing variables values using POST

    i am presently passing the value of a variable to a php file using GET after data has been inserted to the database.

    ex=

    $firstname = $_POST["firstname"];

    if(!$sqlconnect ion)
    {
    echo "error message";
    }
    else
    {
    header("Locatio n: thankyou.php?fi rstnameis=$firs tname");
    }

    how can i send the value of $firstname using POST instead of GET as the value is presently appearing in the address bar. ideally i would like using POST.

    NOTE = please suggest techniques that does NOT involve javascript in order to pass $firstname using POST method, as i have done the entire validations using php and i have assumed that user has javascript turned off.

    please advice.

    thanks.
  • TheServant
    Recognized Expert Top Contributor
    • Feb 2008
    • 1168

    #2
    Can you post your form. Why can't you just use method="POST" in your form submission?

    Comment

    • rpnew
      New Member
      • Aug 2007
      • 189

      #3
      Originally posted by runway27
      i am presently passing the value of a variable to a php file using GET after data has been inserted to the database.

      ex=

      $firstname = $_POST["firstname"];

      if(!$sqlconnect ion)
      {
      echo "error message";
      }
      else
      {
      header("Locatio n: thankyou.php?fi rstnameis=$firs tname");
      }

      how can i send the value of $firstname using POST instead of GET as the value is presently appearing in the address bar. ideally i would like using POST.

      NOTE = please suggest techniques that does NOT involve javascript in order to pass $firstname using POST method, as i have done the entire validations using php and i have assumed that user has javascript turned off.

      please advice.

      thanks.
      Hi,
      As "The Servant" said use 'method=POST' and if you still have any problem. Post your code of the form here so that we can help you better..

      Regards,
      RP

      Comment

      Working...