starhawk85 Posted May 22, 2012 Share Posted May 22, 2012 hello all again, i yet again find my self in a rut and unsure how to go about this. i have done some search and unsure what i might be looking for. My code: <?php //error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING); error_reporting(E_ALL); $include_dir = "./include"; include ("$include_dir/commonfuncs.php"); //extract(getHttpVars()); if (isset($_GET['query'])) $query = $_GET['query']; if (isset($_GET['search'])) $search = $_GET['search']; if (isset($_GET['domain'])) $domain = $_GET['domain']; if (isset($_GET['type'])) $type = $_GET['type']; if (isset($_GET['catid'])) $catid = $_GET['catid']; if (isset($_GET['category'])) $category = $_GET['category']; if (isset($_GET['results'])) $results = $_GET['results']; if (isset($_GET['start'])) $start = $_GET['start']; if (isset($_GET['adv'])) $adv = $_GET['adv']; $include_dir = "./include"; $template_dir = "./templates"; $settings_dir = "./settings"; $language_dir = "./languages"; require_once("$settings_dir/database.php"); require_once("$language_dir/en-language.php"); require_once("$include_dir/searchfuncs.php"); require_once("$include_dir/categoryfuncs.php"); include "$settings_dir/conf.php"; include "$template_dir/$template/header.html"; include "$language_dir/$language-language.php"; if ($type != "or" && $type != "and" && $type != "phrase") { $type = "and"; } if (preg_match("/[^a-z0-9-.]+/", $domain)) { $domain=""; } if ($results != "") { $results_per_page = $results; } if (get_magic_quotes_gpc()==1) { $query = stripslashes($query); } if (!is_numeric($catid)) { $catid = ""; } if (!is_numeric($category)) { $category = ""; } if ($catid && is_numeric($catid)) { $tpl_['category'] = sql_fetch_all('SELECT category FROM '.$mysql_table_prefix.'categories WHERE category_id='.(int)$_REQUEST['catid']); } $count_level0 = sql_fetch_all('SELECT count(*) FROM '.$mysql_table_prefix.'categories WHERE parent_num=0'); $has_categories = 0; if ($count_level0) { $has_categories = $count_level0[0][0]; } require_once("$template_dir/$template/search_form.html"); function getmicrotime(){ list($usec, $sec) = explode(" ",microtime()); return ((float)$usec + (float)$sec); } function poweredby () { global $sph_messages; print $sph_messages['Powered by'];?> <?php } function saveToLog ($query, $elapsed, $results) { global $mysql_table_prefix; if ($results =="") { $results = 0; } $query = "insert into ".$mysql_table_prefix."query_log (query, time, elapsed, results) values ('$query', now(), '$elapsed', '$results')"; mysql_query($query); echo mysql_error(); } switch ($search) { case 1: if (!isset($results)) { $results = ""; } $search_results = get_search_results($query, $start, $category, $type, $results, $domain); require("$template_dir/$template/search_results.html"); break; default: if ($show_categories) { if ($_REQUEST['catid'] && is_numeric($catid)) { $cat_info = get_category_info($catid); } else { $cat_info = get_categories_view(); } require("$template_dir/$template/categories.html"); } break; } include "$template_dir/$template/footer.html"; ?> What i want to do is : IF search_results.html HIDE search_form.html that's the simplicity to exactly what i want to do, explained: I want to have the search results show without the search form. Quote Link to comment https://forums.phpfreaks.com/topic/262941-hide-or-dont-show/ Share on other sites More sharing options...
PeoMachine Posted May 23, 2012 Share Posted May 23, 2012 Verify if search was performed. If yes, you show your results, else you show your form. Something like: if(isset($_GET['search'])) include 'search_results_page.php'; else include 'search_form.php'; Quote Link to comment https://forums.phpfreaks.com/topic/262941-hide-or-dont-show/#findComment-1348164 Share on other sites More sharing options...
starhawk85 Posted May 24, 2012 Author Share Posted May 24, 2012 I have attempted to implement this into my code in various ways, i have had no success so far but i would guess this would be close to it. i did change file name and paths as well and have yet to figure out exactly how i will implement this into my code. as you can see from my code it may be difficult to apply such terms to get desired results. code i dont want to show upon results CODE: } require_once("$template_dir/$template/search_form.html"); function getmicrotime(){ and what i believe to be the results call: switch ($search) { case 1: if (!isset($results)) { $results = ""; } $search_results = get_search_results($query, $start, $category, $type, $results, $domain); require("$template_dir/$template/search_results.html"); break; default: if ($show_categories) { if ($_REQUEST['catid'] && is_numeric($catid)) { $cat_info = get_category_info($catid); } else { $cat_info = get_categories_view(); } require("$template_dir/$template/categories.html"); } break; } Quote Link to comment https://forums.phpfreaks.com/topic/262941-hide-or-dont-show/#findComment-1348279 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.