jjmusicpro Posted July 13, 2007 Share Posted July 13, 2007 For some reason, i cant seem to post values, so the page i am sending the person to wont grab the values i posted. on my main page, i have this code. while($row = mysql_fetch_array($result, MYSQL_ASSOC)){ $site = $row['redirect_url'] ; echo "<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=$site\">"; } Then on my recieving page i have this: <?php $searchsomewhere = $_POST['zipcode_entered_search']; echo $searchsomewhere; ?> It just wont post the values. Quote Link to comment Share on other sites More sharing options...
cybercrypt13 Posted July 13, 2007 Share Posted July 13, 2007 Maybe I'm missing something but what exactly are you trying to do here? A redirect is not going to post vars over with it. This is not how you do a post. You basically have 2 ways to deal with this as far as I know. 1) You can do a form post event to hook a post page to a button which automatically will send over your fields, or you can pass things over with a normal html link and pass the fields as query strings. <form name="Login" method="post" action="index.php"> <input type="submit" value="<?=$lang[ "LoginButton" ]; ?>" onclick="" id="btn_Login" /> </form> Or query string: --a href="http://www.mydomain.com/index.php?var1="hello">click me</a> Hope that helps... Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 13, 2007 Share Posted July 13, 2007 What are you trying to do? you are setting a huge amount of meta data that is going to refresh the document a bunch till you get to the last version. Quote Link to comment Share on other sites More sharing options...
jjmusicpro Posted July 13, 2007 Author Share Posted July 13, 2007 What i am doing is.. The user goes to the main page, and enters a zipcode, then 3 things can happen... if a result is found, only 1, it will redirect them to a new url in the database if 2 results, it will loop through results if 0 results, then it will redirect them to a page i am now where it needs to post the zipcode entered in a string like "we couldnt find your xxxxxx zip, please...." Quote Link to comment Share on other sites More sharing options...
cybercrypt13 Posted July 13, 2007 Share Posted July 13, 2007 Well, honestly I don't believe I'd be going to all that trouble. I think it might be a bit easier if you actually have a single page that does all of that. Enter the zipcode, post back to the same page where you have a couple if statements. If you have a post back var $_POST[... then you do one thing and display your need to enter more info, or found it and moving on, or found more than 1 please choose. Doing redirects is not what you want to be doing because they don't carry over fields. You are basically telling the server that you don't want to be here so please go there. Nothing goes along with you. hope that helps, 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.