i am kind of a newbie with PHP. I have been doing some ASP programing but i wanna switch and here is my problem with this search function i am trying to achieve :
what i need is
- a first page with one drop down that leads me to a second page with 2 new filtered drop downs.
so far, that works fine.
- my problem comes with the result page, sadly empty when i submit my search from the second page.
i know coding with dreamweaver might not be the best when it comes to php but this is all i have so far before learning more of that language.
i know this code might look absurd to experienced coders, but hey, i am learning....
here is the php for the result page
Code: Select all
<?php require_once('Connections/..............php'); ?>
<?php
$scat_rsresults = "1";
if (isset($GET['tb_cat'])) {
$scat_rsresults = (get_magic_quotes_gpc()) ? $GET['tb_cat'] : addslashes($GET['tb_cat']);
}
$srubrique_rsresults = "1";
if (isset($GET['tb_rubrique'])) {
$srubrique_rsresults = (get_magic_quotes_gpc()) ? $GET['tb_rubrique'] : addslashes($GET['tb_rubrique']);
}
$sregion_rsresults = "1";
if (isset($GET['tb_region'])) {
$sregion_rsresults = (get_magic_quotes_gpc()) ? $GET['tb_region'] : addslashes($GET['tb_region']);
}
mysql_select_db($database_con_annuaire, $con_annuaire);
$query_rsresults = sprintf("SELECT * FROM sheet1 WHERE tb_cat = '%s' AND tb_rubrique LIKE '%s' AND tb_region LIKE '%s'", $scat_rsresults,$srubrique_rsresults,$sregion_rsresults);
$rsresults = mysql_query($query_rsresults, $con_annuaire) or die(mysql_error());
$row_rsresults = mysql_fetch_assoc($rsresults);
$totalRows_rsresults = mysql_num_rows($rsresults);
?>thanks for taking a look. please let me know if you need more info about the thing. maybe there is a good tutorial for that somewhere as well..