Page 1 of 1

PHP search, multiple parameters with drop down menu, HELP !

Posted: Thu Sep 20, 2007 12:18 pm
by alioso
Hello all,

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..

Posted: Sat Sep 22, 2007 6:44 am
by mezise
Hi,
as a result of posted PHP code you have got an empty page, right? First thing to do is to be sure if there are no errors in PHP code:

1. Check your php error log file in path defined in php.ini file under error_log = "DEFINED_PATH" or if it is commented out check Apache error log for PHP errors.

2a. Check your php.ini file for these lines:

Code: Select all

error_reporting = E_ALL
display_errors = On
2b. Above flags you may set in your PHP code:

Code: Select all

<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
?>
<?php require_once('Connections/..............php'); ?>
<?php 
 ...
?>
3. Refresh the page.

If there won't be any errors, let us know.

Michal