include 'include/connect.php'; include 'include/Form.php'; ?> $curform=new Html_form('view_faq.php','post','form1','','','chk_all',''); $curform->start(); $search_in = array("answer"=>"Answers","q_text"=>"Questions","both"=>"Both"); //SEARCH print "
Search For : "; $curform->displaytext('search_text','','30','50','','',''); print " | "; print "Search in : "; $curform->displaySelect('search_in', $search_in,'','','','-- SELECT --','',''); print " | "; print " |
Please select a Subject / Category : "; // *********************************************** //get site name and fetch subjects assigned to it. //$host = "www.frlht.org.in"; //$host = "www.homeremedy.in"; //$host = "envis.frlht.org.in"; //print "host: ".$_SERVER['HTTP_HOST']; //GET ELEMENTS SEPERATED BY 'DOT' i.e. '.' $e = explode(".",$_SERVER['HTTP_HOST']); //$e = explode(".",$host); if($e[0]=="www") //USE 2ND ELEMENT AS URL STARTS WITH WWW. { $tmp = $e[1]; } else //USE 1ST ELEMENT AS URL STARTS WITH THE DOMAIN NAME. { $tmp = $e[0]; } //print $temp; //GET SITE ID $siteid = fetch_me("websites","site_id","second_name",$tmp); //GET SUBJECTS RELATED TO THIS SITE $s = "SELECT * FROM subject INNER JOIN subject_site ON subject.sub_id= subject_site.subject_id WHERE subject_site.site_id=$siteid ORDER BY subject.sub_name"; $r = mysql_query($s); $ary = Array(); while($rw=mysql_fetch_array($r)) { $ary[$rw["sub_id"]]=trim($rw["sub_name"]); }//while // *********************************************** //SUBJECT DROPDOWN. $ary IS THE ARRAY OF SUBJECTS $curform->displaySelect('sub_id', $ary,'','','','-- SELECT --','',''); print " |
$msg |
---|
$rw->q_text |
$rw->answer |
NO MATCH FOUND |