MDanz Posted October 14, 2009 Share Posted October 14, 2009 i originally had this but realised it is much easier to have a button. <?php $search = $_GET['search']; $checkbox = $_GET['checkbox']; if($checkbox == 'on') { include("searchtopic.php?search=$search"); } else { include("searchnormal.php?search=$search"); } ?> how do i make a button that anytime it is clicked it refreshes the page and includes the opposite of whatever searchtype it was previously on (searchnormal.php or searchtopic.php)? Link to comment https://forums.phpfreaks.com/topic/177685-button-help/ Share on other sites More sharing options...
mrMarcus Posted October 14, 2009 Share Posted October 14, 2009 echo '<a href="'.((isset ($checkbox) && ($checkbox == 'on')) ? 'searchtopic.php' : 'searchnormal.php').'?search='.$search.'">Blah Blah</a>'; Link to comment https://forums.phpfreaks.com/topic/177685-button-help/#findComment-936880 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.