As the title says, i'm trying to retain the value submitted from a text form. so I thought the following simple code on the pre-process page would do the trick but the text box is still blank.
<form id="form1" name="form1" method="get" action="pre_process.php">
<input name="q" type="text" value="<?php $_GET['q']; ?>" size="80"/>
Any suggestions?
Thanks
Try:
<input name="q" type="text" value="<?php echo $_GET['q']; ?>" size="80"/>
You need to echo the value out.
To avoid Notices you should use the isset function to check if the value was set
Your code should look like:
<input name="q" type="text" value="<?php echo isset($_GET['q']) ? $_GET['q'] : NULL; ?>" size="80"/>
You forgot to call echo. Your code should read:
<?php echo $_GET['q']; ?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With