MDanz Posted August 6, 2009 Share Posted August 6, 2009 Want to send the search results to a hidden form and have the hidden form save it. So that when i search for something new the old results are still displayed. can i have an example, i'll implement it in my own way. Link to comment https://forums.phpfreaks.com/topic/169154-hidden-forms/ Share on other sites More sharing options...
MDanz Posted August 6, 2009 Author Share Posted August 6, 2009 basically i'm thinking for the hidden form <form action='search.php' method='get'> \\echo results </form> I don't know how to send results to the hidden form though, is this done all within 1 php file? so i have the search engine and hidden form in one php file? Link to comment https://forums.phpfreaks.com/topic/169154-hidden-forms/#findComment-892533 Share on other sites More sharing options...
smerny Posted August 6, 2009 Share Posted August 6, 2009 <input type='hidden' name='previousSearch' value='".$previousSearch."'> something like that? Link to comment https://forums.phpfreaks.com/topic/169154-hidden-forms/#findComment-892534 Share on other sites More sharing options...
MDanz Posted August 6, 2009 Author Share Posted August 6, 2009 <?php //get data $button = $_GET['submit']; $search = $_GET['search']; if (!$button) echo "You didn't submit a keyword"; else { if(!isset($search) || strlen($search)<=2) echo "<br><font color=white>search term too short</font>"; else { echo "<br><br><font color=white>you searched for <b>$search</b></font><hr size='1'>"; } mysql_connect("localhost", "Master", "password"); mysql_select_db("Login"); //explode our search term $search_exploded = explode(" ",$search); foreach($search_exploded as $search_each) { //construct query $x++; if($x==1) $construct .= "keywords LIKE '$search_each'"; else $construct .= "OR keywords LIKE '$search_each'"; } //echo out $construct $construct = "SELECT * FROM Upload WHERE $construct"; } $run = mysql_query($construct); $foundnum = mysql_num_rows($run); if ($foundnum==0) echo "<br><br><font color=white>No Stacks Found</font>"; else { echo "<font color=white>$foundnum Stacks Found!</font><p>"; if($_GET['RadioGroup1']== 1 ) $margin = 'style="margin-left:60px"'; else if($_GET['RadioGroup1']== 2 ) $margin = 'style="margin-left:120px"'; else if($_GET['RadioGroup1']== 3 ) $margin = 'style="margin-left:180px"'; else if($_GET['RadioGroup1']== 4 ) $margin = 'style="margin-left:240px"'; else if($_GET['RadioGroup1']== 5 ) $margin = 'style="margin-left:300px"'; else if($_GET['RadioGroup1']== 6 ) $margin = 'style="margin-left:360px"'; else if($_GET['RadioGroup1']== 7 ) $margin = 'style="margin-left:420px"'; else if($_GET['RadioGroup1']== 8 ) $margin = 'style="margin-left:480px"'; else $margin = 'style="margin-left:0px"'; echo '<br><table '.$margin.'>'; while ($runrows = mysql_fetch_assoc($run)) { //get data $name = $runrows['name']; $image = $runrows['image']; $hyperlink = $runrows['hyperlink']; $currency = $runrows['currency']; $info = $runrows['info']; $type = $runrows['type']; echo '<tr><td>'; switch ($type) { case 'I': echo '<img src="http://www.u-stack.com/Image.jpg">'; break; case 'M': echo '<img src="http://www.u-stack.com/Music.jpg">'; break; case 'F': echo '<img src="http://www.u-stack.com/File.jpg">'; break; case 'V': echo '<img src="http://www.u-stack.com/Video.jpg">'; break; case 'J': echo '<img src="http://www.u-stack.com/Job.jpg">'; break; case 'D': echo '<img src="http://www.u-stack.com/Discussion.jpg">'; break; case 'P': echo '<img src="http://www.u-stack.com/Product.jpg">'; break; } echo '</td></tr>'; } echo '</table>'; } ?> ^^this is a working search engine, how would i submit the results i'm echoing into the hidden form? And the hidden form echo the results back to the search engine. So when i do a new search the results are still displayed.. ..not asking you to do it, just really need some help Link to comment https://forums.phpfreaks.com/topic/169154-hidden-forms/#findComment-892539 Share on other sites More sharing options...
smerny Posted August 6, 2009 Share Posted August 6, 2009 where's your form? i'm sorry, i don't really understand what you are looking for Link to comment https://forums.phpfreaks.com/topic/169154-hidden-forms/#findComment-892546 Share on other sites More sharing options...
MDanz Posted August 6, 2009 Author Share Posted August 6, 2009 ok in simple... an example any kind how do i post results into a hidden form and retrieve results from that hidden form? Link to comment https://forums.phpfreaks.com/topic/169154-hidden-forms/#findComment-892547 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.