Thundarfoot Posted February 6, 2008 Share Posted February 6, 2008 I have a problem with adding page navigation to my script. My problem is when the user clicks the navigation button I get this error 'empty (sub)expression' from regexp. what I need to do is take the below code where I assign my variable and make it use the last value it held if a null value is returned? is that possible? $name = $_POST['select']; // Gets its value from a drop down selct form // Thanks for your help. Quote Link to comment Share on other sites More sharing options...
haku Posted February 6, 2008 Share Posted February 6, 2008 If you want to do that, you are going to have to store the values it held previously. You can do that in a database, a cookie, a hidden tag, or a GET/POST variable. If you save it in a session variable ($_SESSION['name']) then you could do something like this: if($_POST['select'] == "") { $name = $_SESSION['name']; } else { $name = $_POST['select']; } Quote Link to comment Share on other sites More sharing options...
Thundarfoot Posted February 6, 2008 Author Share Posted February 6, 2008 thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.