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. Link to comment https://forums.phpfreaks.com/topic/89676-solved-_postselect-null-help/ 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']; } Link to comment https://forums.phpfreaks.com/topic/89676-solved-_postselect-null-help/#findComment-459544 Share on other sites More sharing options...
Thundarfoot Posted February 6, 2008 Author Share Posted February 6, 2008 thanks Link to comment https://forums.phpfreaks.com/topic/89676-solved-_postselect-null-help/#findComment-459563 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.