Hi y'all, I'm sorry if I'm asking this again, but how can I do a conditional statement in PHP that will jump out of the page/php and go to another page. I have a search page, and if certain keywords are entered, I don't want the search page to be displayed (with or without results). Instead, I want a new page (associated with the keyword) to load. Basically, jump off the php page. Thanks. Rob
Thanks. Unfortunately, that's not going to work because (and sorry for not mentioning/explaining this before) I want it to work on the submission of my form, which has to be hardcoded, right? <form name="searchform" method="POST" action="some_page.php"> What I'd like to be able to do is make the action of the post a variable, so that I can direct to other pages. Probably asking too much. <form name="searchform" method="POST" action="$some_var"> if(condition){$some_var="http://page.html");}
how you are checking the condition. the keywords here will represent as string and you need to use some string manipulation function.
in php just use header("Location: yourpage.php"); switch($a) { case 1: header("Location: yourpage.php"); break; case 2: header("Location: yourpage2.php"); break; } also submit your form to a page where this code resides.. there are many functions you can use in redirecting to other page/s