Accurax Posted March 13, 2007 Share Posted March 13, 2007 I'm posting some variables to a script that runs a search based on the POST variables that i assign to normal variables, but i also want to have the page paginated. It all works, however, when i try to go to any page but the first, i get an error telling me that my post variables are undefined, the error code looks like this: Notice: Undefined index: search_sex in C:\wamp\www\mydirectory\test.php on line 17 i get one of those for each of my POST variables. I have tried to move the POST's into SESSIONS but it made no difference. Is there a way around this? Link to comment https://forums.phpfreaks.com/topic/42534-pagination-and-_post-question/ Share on other sites More sharing options...
mjlogan Posted March 13, 2007 Share Posted March 13, 2007 That will only pop up when a user does not select one of the options. You might have a variable name mismatch somewhere, if you don't get that on the first page, but when you try pass it to another its blank. Check it is also set on the first page. Link to comment https://forums.phpfreaks.com/topic/42534-pagination-and-_post-question/#findComment-206375 Share on other sites More sharing options...
Accurax Posted March 13, 2007 Author Share Posted March 13, 2007 ive tried passing the variables into sessions to keep them alive, as i thought they were dying after the first page was moved on from. problem is i could have 500 results, and i only want to display them in blocks of 10 or so per page, so i cant ignore this functionality. no matter what i do it actually asks (see abover error) for the $_POST variable "by name" ... search_sex etc all very confusing especially since the only time search_sex is even used on this page is when i assign it $sex = $_POST['search_sex']; Link to comment https://forums.phpfreaks.com/topic/42534-pagination-and-_post-question/#findComment-206382 Share on other sites More sharing options...
mjlogan Posted March 13, 2007 Share Posted March 13, 2007 paste print_r($_POST); at the top of the page, as see if it outputs, $_POST[search_sex] in the array. Because if $sex = $_POST['search_sex']; is line 17, then check your HTML that the field is called search_sex Link to comment https://forums.phpfreaks.com/topic/42534-pagination-and-_post-question/#findComment-206389 Share on other sites More sharing options...
Accurax Posted March 13, 2007 Author Share Posted March 13, 2007 it is ..... I think its down to subsequent pages not recognising the POST variables.... so im going to play with some isset ifelse statements and see if i can get something that works thanks guys Link to comment https://forums.phpfreaks.com/topic/42534-pagination-and-_post-question/#findComment-206410 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.