I have a webpage with a php script. At the beginning of the script, I set the value of the message variable with the following. $message = $_GET['msg3']; msg3 is coming from the url. That is working fine because I am printing $message correctly on the webpage. The webpage has a form and the rest of the php script is run when the form is submitted. The problem is that when the form is run, $message is now empty. How do I get it to retain the value. Thanks for the help.
here is two ways to do that, 1 - either store the $message variable in a session: Session_start(); $_session[‘message’] = $message; PHP: Then when the form is submitted you can use: $message = $_session[‘message’]; PHP: 2- The second way would be to store the $message in a hidden field of the form and retrieve it when the form is submitted. <form action="" method="get"> other form input here <input name="message" type="hidden" value="<?php echo $message; ?>" /> </form> PHP: good luck