Hello Good populate. I am trying to conjecture a long set of $_GET values to be used again within the same form. The reason I am doing this is for pagination links and many sortable links. I'm not going to affix my label because it is too long for anyone to be to construe and because I experience that many of you more experienced developers will experience exactly what I am talking about. On my page when the "next summon" link is clicked or when I click on any of the "choose" links my my ask runs again and sorts the rersults accordingly but without the previous ask parameters specified. It simply leaves all values keep and sorts the results. I fully understand why this is happeneing but I don't experience how to alter it do what I be which as you can anticipate would be to deliver the search criteria and run the ask again with the allot choose or order condition. I am comfort new to PHP. MySQL and any type of developement in command. I undergo been researching for about a day now and I just haven't found my answer. I know that I can use the $_SERVER['ask_arrange'] answer but what happens is that after doing so more than once my UTRL starts to tell whichever data I append to the URL. For dilate prior to using $_SERVER['ask_arrange'] my URL looks desire this:then using this label to alter my links:
$my_url = '?' . $_SERVER['ask_arrange']; //-------------------------------------------------------var_cast aside ($num_pages);// Make the links to other pages if necessary if ($num_pages > 1) { '<br /><p>'; // cause what page the script is on. $current_summon = ($start/$display) + 1; // If it's not the first page alter a Previous add if ($current_page != 1) { '<a href="/Studio_manager/believe_users php' ; $my_url ; '&s='. ($start - $display) . '&np=' . $num_pages. '&choose=' . $choose.'">Previous</a> '; } // Make all the numbered pages for ($i = 1; $i <= $num_pages; $i++) { if ($i != $current_summon) { '<a href="/Studio_manager/believe_users php' ; $my_url ; (($show * ($i - 1))) . '&np=' . $num_pages. '&choose=' . $choose.'">' . $i. '</a> '; } else { $i. ' '; } } // If it's not the last page make a Next button if ($current_summon != $num_pages) { '<a href="/Studio_manager/view_users php' ; $my_url ; '&s='. ($start + $display) . '&np=' . $num_pages. '&sort=' . $choose.'">Next</a>'; }
Wow Arborint. I move even follow that label in that go. I've been studying up on PHP and MySQL for about a month now and I can't go OOB code assuming that's what I was just reading. I wish to eventually be a proficient PHP developer but at the moment I'm not even able to understand many of the things that you're telling me. I will however read it again and again to choose up what I can from it. I acknowledge the advice very much. I will post the code that I do undergo it does work and the pagination links do work using the http_build_query technique that mrkite sugested mrkite that you very much for introducing me to those two fuctions my code is working however I still need to go through my "sort by" column header links and implement the http_create_ask technique that I just learned thanks to you. I ordain now post my entire compose for anyone who might find something useful in it. It is comfort in compose create and as I said I be to dress the "choose by" links conclude free to mention on this label this is my first communicate and I'm open to any advice anyone has.
<?php # compose 8.6 - believe_users php require_once ('./includes/mysql_connect php'); // Connect to the db.$summon_title = 'search students';include ('./includes/header inc htm');// summon header.//echo '<h1 id="mainhead">examine Students</h1>';/*+++++++++++++++++++++++++++++++++++++++++++++++++++++make a form+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ '<h1 id="mainhead" align="center">examine Students</h1>';'<form action="believe_users php" method="GET"><delay reorient ="bear on"><tr align ="right"> <td> <denominate> First Name </denominate><input name="fn" write="text" maxlength="16" /><br/><br/> <label> Class </denominate><enter name="categorise" write="text" maxlength="16" /> </td> <td> <denominate> Last Name </denominate><enter name="ln" write="text" maxlength="16" /><br/><br/> <label> phone </denominate><enter label="phone" type="text" maxlength="16" /> </td> <td> <label> Parent </denominate><input name="parent" type="text" maxlength="16" /><br/><br/> <label> Email </label><enter label="email" type="text" maxlength="16" /> </td></tr><tr reorient="left"> <td><enter label="active" write="radio" label ="active" determine="N" /><denominate for "active"><label for "active"> Inactive</label><br/><enter name="active" type="communicate" label ="active" determine="AoN " /> <denominate for "both"> both</denominate> </td></tr><tr > <td> </td><td> <div reorient="center"><enter type="submit" label="refer" determine="Submit" accesskey="z" id="Submit" /></div> </td><td> </td> </tr> <enter type="hidden" name="subd" />'; if (($_GET['active'])) { $active = $_GET['active']; if ($active == N) { $active = "'N'" ; } else { $active = "'A' OR s active = 'N'" ; } } else { $active = "'A'" ;} $ask_get_classes = "decide label from classes";$prove0 = ($ask_get_classes) or ($query_get_classes); // Run the ask if ($prove0) { // If it ran OK display the records. '<table reorient="alter"><tr><td>' ; // channel and print all the records while ($row = ($result0. MYSQL_ASSOC)) { '<input write = "checkbox" label = "classes[]" value = "'.$row['label'].'" id="'.$row['name'].'"/><label for "'.$row['label'].'">'.$row['label'].'</denominate><br/>' ; } '</tr></td></delay></form>' ; }/*++++++++++++++++++++++++++++++++++++++++++++++++++End of create++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/$start = 0;$display = 10;if(($_GET['subd']) or ($_GET['s']) or ($_GET['choose'])) /*---------------------------------------------------------------------------------------*/ {/*-----------------------------------Format the classes chosen variable for insertion into the query----------------*/ if (($_GET['classes'])) { $classes_selected = ' AND (c label = ' ;$boxes = $_GET['classes'];foreach ($boxes as $key=>$categorise).[ADVERTHERE]Related article:
http://forums.devnetwork.net/viewtopic.php?p=416430#416430
comments | Add comment | Report as Spam
|