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. Quote Link to comment 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'] != '')) Quote Link to comment 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'); } 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.