View Single Post
  #1 (permalink)  
Old 2003-09-30, 08:33 PM
wa8in42night wa8in42night is offline
Junior Member
 
Join Date: Sep 2003
Posts: 3
wa8in42night
Default

Hi every one!
I have been developing PHP applications from last one year, all the time I have been using Hidden fields and Query strings to pass my variable within the same page or to a different page.
Current Situation:
Right now I have a search page "searchMembers.php" I am making an SQL query based upon the user choice. Depending upon the number of rows returned in the search result I am printing links to the other RESULT PAGES (1 | 2 | 3 | NEXT). To access the SQL query I have made based upon the user choice, I am sending my query with the URL to all other result pages by doing the following php work
PHP Code:
// seralize sql query 
$serial_var = serialize($searchQuery); 
//encode sql query 
$out_var = rawurlencode($serial_var); 
// save encoded query to a variable 
$searchquery = $out_var; 
// then attach this sql query to the URLs to other pages in following way 
// a for loop to print links to number of pages of i.e. 1 | 2 | Next 
for (&#036;i = 0; $i < $pages; $i++) 

     &
#036;url = "$ME?screen=" . $i ; 
      // here I am attaching my encoded query to Query String 
     
&#036;myhtml .="<FONT =\"#000000\"> | <a    href=\"$url&amp;searchfor=$searchfor&amp;searchquery=$searchquery\">". ($i+1)."</a> |</FONT>\n"; 

MY PROBLEM:
so for I have been able to attach query to the query string but when I can not get my full query when I get the variable saved in the query string, just to clarify the situation I am using decode and unseralize method when I am retreing my variable in the following way
PHP Code:
&#036;myQuery = unserialize(rawurldecode($_GET["searchquery"])); 
&#036;qid = new PGM_Sql(); 
&#036;qid->query($myQuery); 
&#036;resultNumOfRows = $qid->num_rows(); 
SO ANY ONE PLEASE SUGGEST ME THE BEST WAY TO PASS THIS QUERY TO THE SAME PAGE, I AM SURE THIS ONE WOULD BE SIMPLE FOR MANY OF YOU BUT I CANT FIND THE WAY OUT OF IT.
Reply With Quote