klepec Posted April 4, 2012 Share Posted April 4, 2012 I have an url, for example: something.com/page.php?value=something $test = mysql_real_escape_string($_GET['value']); I require this variable $test after the submit button is pressed, but the url does not keep it anymore. (../page.php). Is there a way i could keep it after the submit? if (isset($_POST["Submit"])) { operating with $test... } form... Link to comment https://forums.phpfreaks.com/topic/260325-keep-get-variables-after-submit/ Share on other sites More sharing options...
litebearer Posted April 4, 2012 Share Posted April 4, 2012 a) put it a hidden field, or b) put it in a session variable Link to comment https://forums.phpfreaks.com/topic/260325-keep-get-variables-after-submit/#findComment-1334248 Share on other sites More sharing options...
klepec Posted April 4, 2012 Author Share Posted April 4, 2012 Ok solved it myself. action="<?php echo $_SERVER['PHP_SELF']."?".$_SERVER["QUERY_STRING"]; ?>" Link to comment https://forums.phpfreaks.com/topic/260325-keep-get-variables-after-submit/#findComment-1334251 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.