0

I have a form that has name, Id, address etc. It needs to refresh after user enters the ID inorder to query and retrieve other information such as major based the entered ID. Once it refreshes, I retrieve back the entered values via Get method so to retain the entered form values. Shown below

      <?php
       $_SESSION['Bid']=@$_GET['Bid'];
       $_SESSION['Stufname']=$_GET['fname'];
       $_SESSION['Stulname']=$_GET['lname'];
       ?>

      <form name="form1" method="post" action="registration.php" >

       <input type="text"  name="Bid"  value="<?php echo $_SESSION['Bid'];?>" 
      MAXLENGTH=9    size="9">  

      </form>

All works fine but i know GET method is unsecure since the variables are now shown in the URL and I want to get away from using get. I tried session variable in other scripts but in this case, because the page refreshes after entering ID, I am not really sure how to capture and store the form values in the session variables on page refresh without using the GET method as I did above.

Any help would be appreciated. thanks,

1 Answer 1

1

You can use POST rather. You'll be able to figure out the syntax from here: http://www.w3schools.com/php/php_post.asp but I'd recommend doing more research before posting a question.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you, POST wont work here because this is not a submit event. The page reloads but is not posted to the registration.php page, ofcourse in registration.php I can use POST. So POST wont work on reload. I did research quite a bit but couldnt find a suitable solution yet.
The page reloads and is in the same page, its not posted to registration.php.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.