ramsfield Posted January 28, 2008 Share Posted January 28, 2008 I have a search form page, which sends data to page that sets cookies, then redirects to the search results. What I would like to do is first check to see if 1 of the 5 form fields that was submitted to the setcookie page has something in it. If none are set, then return them to the search page. If at least 1 or more are set, send them to the search results page. Link to comment https://forums.phpfreaks.com/topic/88283-solved-check-form-variables-then-process/ Share on other sites More sharing options...
amites Posted January 28, 2008 Share Posted January 28, 2008 if (isset($_POST['FORM_VAL_1']) AND ($_POST['FORM_VAL_1'] != '')) Link to comment https://forums.phpfreaks.com/topic/88283-solved-check-form-variables-then-process/#findComment-451751 Share on other sites More sharing options...
ramsfield Posted January 29, 2008 Author Share Posted January 29, 2008 Thanks for your help, below is what I used to get it to work if(empty($_POST['txtcaseno']) && empty($_POST['txtparcel']) && empty($_POST['txtlname']) && empty($_POST['txtfname']) && empty($_POST['txtstreet'])){ header('Location: index.php'); exit(); } else { $caseno = $_POST['txtcaseno']; $parcelno= $_POST['txtparcel']; $lname= $_POST['txtlname']; $fname= $_POST['txtfname']; $street= $_POST['txtstreet']; $time = time(); // Gets the Current Server Time setcookie("MasonCoPermits[caseno]", $caseno, $time + 3600); setcookie("MasonCoPermits[parcelno]", $parcelno, $time + 3600); setcookie("MasonCoPermits[lname]", $lname, $time + 3600); setcookie("MasonCoPermits[fname]", $fname, $time + 3600); setcookie("MasonCoPermits[street]", $street, $time + 3600); header('Location: search_results.php'); } Link to comment https://forums.phpfreaks.com/topic/88283-solved-check-form-variables-then-process/#findComment-451820 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.