1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
|
<?php require_once('Connections/maconnection.php');
$table = 'article';
if (isset($_GET['continent']))
{ $valeurA = mysql_real_escape_string($_GET['continent']); }
else
{ $valeurA = ''; }
if (isset($_GET['pays']))
{ $valeurB = mysql_real_escape_string($_GET['pays']); }
else
{ $valeurB = ''; }
if (isset($_GET['theme']))
{ $valeurC = mysql_real_escape_string($_GET['theme']); }
else
{ $valeurC = ''; }
?>
<?php
if (!function_exists("GetSQLValueString"))
{function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType)
{
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_madatabase, $mabdd);
$query_article = "SELECT * FROM article WHERE id = id";
$article = mysql_query($query_article, $mabdd) or die(mysql_error());
$row_article = mysql_fetch_assoc($article);
$totalRows_article = mysql_num_rows($article);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<title>essai_3_listes</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" media="screen" type="text/css" title="Design" href="design.css" />
<style type="text/css">
<!--
.Style5 {font-size: 18}
-->
</style>
</head>
<body>
<div id="apDiv12">
<form id="copath" method="GET" >
<span class="Style1 Style5">Vous pouvez effectuer une recherche par <strong>Continent , Pays et Thème.</strong></span> <br />
<select name="continent" onchange="document.getElementById('copath').submit();">
<option value="">Choisissez un Continent</option>
<?php
$SQL_A = 'SELECT DISTINCT continent FROM '. $table. ' ORDER BY continent ASC';
$result_A = mysql_query($SQL_A);
while ($val_A = mysql_fetch_array($result_A))
{
if ($valeurA == $val_A['continent'])
{
$selection = ' selected';
}
else
{
$selection = '';
}
echo '<option value="'. $val_A['continent'] .'"'. $selection .'>';
echo $val_A['continent'];
echo '</option>';
}
echo '</select>';
echo $val_C[''];
mysql_free_result($result_A);
if ($valeurA != '')
{
$SQL_B = 'SELECT DISTINCT pays FROM '. $table .' WHERE continent = \''. $valeurA .'\'';
$SQL_B .= ' ORDER BY pays ASC';
$result_B = mysql_query($SQL_B);
?>
<select name="pays" onchange="document.getElementById('copath').submit();">
<option value="">Choisissez un Pays</option>
<?php
while ($val_B = mysql_fetch_array($result_B))
{
if ($valeurB == $val_B['pays'])
{
$selection = ' selected';
$valeurid = $val_B['id'];
}
else
{
$selection = '';
}
echo '<option value="'. $val_B['pays'] .'"'. $selection .'>';
echo $val_B['pays'];
echo '</option>';
}
echo '</select>';
mysql_free_result($result_B);
if ($valeurB != '')
{
$SQL_C = 'SELECT DISTINCT theme FROM '. $table .' WHERE pays = \''. $valeurB .'\'';
$SQL_C .= ' ORDER BY theme ASC';
$result_C = mysql_query($SQL_C);
?>
<br/>
<select name="theme" onchange="document.getElementById('copath').submit();">
<option value="">Choisissez un Thème</option>
<?php
while ($val_C = mysql_fetch_array($result_C))
{
if ($valeurC == $val_C['theme'])
{
$selection = ' selected';
$valeurid = $val_C['id'];
}
else
{
$selection = '';
}
echo '<option value="'. $val_C['theme'] .'"'. $selection .'>';
echo $val_C['theme'];
echo '</option>';
}
echo '</select>';
mysql_free_result($result_C);
}
}
?>
</form>
</div>
</body>
</html>
<?php
mysql_free_result($article);
?> |
Partager