smonkcaptain Posted March 31, 2011 Share Posted March 31, 2011 Hey All. Say someone was searching my photo database website from a drop down menu. They search for the aircraft: 'Boeing 747' and airline: 'British Airways', which is posted with the url 'result.php?aircraft=Boeing+747&airline=British+Airways'. How would i get my php to echo: Your search for 'Boeing 747 > British Airways' is displayed below: Or if the search was for just: Aspect: Flightdeck, echo: Your search for 'Flightdeck' is displayed below: I hope it's clear, Thanks, Jimmy Link to comment https://forums.phpfreaks.com/topic/232315-echoing-search-criteria/ Share on other sites More sharing options...
AbraCadaver Posted March 31, 2011 Share Posted March 31, 2011 if(!empty($_GET)) { echo htmlentities(implode(' > ', $_GET)); } Link to comment https://forums.phpfreaks.com/topic/232315-echoing-search-criteria/#findComment-1195114 Share on other sites More sharing options...
smonkcaptain Posted March 31, 2011 Author Share Posted March 31, 2011 if(!empty($_GET)) { echo htmlentities(implode(' > ', $_GET)); } Thanks! At the moment it's displaying as so: How can I get it so that the '>' is not bold, and also it how can i echo 'for' before the 'Airbus > Monarch'. Thanks! Link to comment https://forums.phpfreaks.com/topic/232315-echoing-search-criteria/#findComment-1195123 Share on other sites More sharing options...
AbraCadaver Posted March 31, 2011 Share Posted March 31, 2011 You haven't show the code you use to echo that so I have no idea. Link to comment https://forums.phpfreaks.com/topic/232315-echoing-search-criteria/#findComment-1195133 Share on other sites More sharing options...
smonkcaptain Posted March 31, 2011 Author Share Posted March 31, 2011 You haven't show the code you use to echo that so I have no idea. Sorry, completly forgot: <?php if(!empty($_GET)) { $criteria= htmlentities(implode(' > ', $_GET)); }?> <p class="resulttext">Your search <strong><?php echo $criteria;?></strong> returned <strong><?php echo $num;?></strong> photo results, these are displayed below.</p> Link to comment https://forums.phpfreaks.com/topic/232315-echoing-search-criteria/#findComment-1195136 Share on other sites More sharing options...
AbraCadaver Posted March 31, 2011 Share Posted March 31, 2011 $criteria =implode('</strong> > <strong>', array_map('htmlentities', $_GET)); I would just insert the word "for" after "Your search" in the HTML. Link to comment https://forums.phpfreaks.com/topic/232315-echoing-search-criteria/#findComment-1195140 Share on other sites More sharing options...
smonkcaptain Posted March 31, 2011 Author Share Posted March 31, 2011 $criteria =implode('</strong> > <strong>', array_map('htmlentities', $_GET)); I would just insert the word "for" after "Your search" in the HTML. Thanks for that mate that's done it! I could put 'for' before using HTML, however if there is no search criteria is would make no sense; ie. Your search for returned X photo results, these are displayed below. Thanks! Link to comment https://forums.phpfreaks.com/topic/232315-echoing-search-criteria/#findComment-1195148 Share on other sites More sharing options...
smonkcaptain Posted March 31, 2011 Author Share Posted March 31, 2011 $criteria =implode('</strong> > <strong>', array_map('htmlentities', $_GET)); I would just insert the word "for" after "Your search" in the HTML. Thanks for that mate that's done it! I could put 'for' before using HTML, however if there is no search criteria is would make no sense; ie. Your search for returned X photo results, these are displayed below. Thanks! Sorted now, thanks anyway! Link to comment https://forums.phpfreaks.com/topic/232315-echoing-search-criteria/#findComment-1195163 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.