Post Get (isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY
Posted: Wed Mar 12, 2003 7:50 am
Please someone spot my error before I serously blow my brains out.
I have been trying to display $YouSelected and have used every possible comination. One combination displays the Value and one the same value so they are wroing trying other variables I just get nothing at all. The form posts this:
<form action='./TownsCityCompanies.php' method='POST' name='CountySearch'>
<?
require("connection.php");
mysql_connect("$DBHost", "$DBUser", "$DBPass") or
die("could not connect");
mysql_select_db("$DBName");
echo "<select name=\"CountyID\" size=\"1\" class='menuForm'>";
$result=mysql_query("SELECT County, CountyID FROM county ORDER BY County");
while ($row = mysql_fetch_array($result))
{
$county_id=$row['CountyID'];
$county=$row['County'];
echo "<option value=\"$county_id\"> $county </option>";
}
echo "</select>";
which then gets picked up in this file TownsCityCompanies.php
echo "<select name=\"CountyID\" size=\"1\" class='menuForm'>";
$result=mysql_query("SELECT County, CountyID FROM county ORDER BY County");
while ($row = mysql_fetch_array($result)) {
$county_id=$row['CountyID'];
$county=$row['County'];
echo "<option value=\"$county_id\"";
if ($CountyID == $county_id)
{echo " selected";}
echo "> $county </option>";
}
echo "</select>";
in this file it is this that is causing pain and misery
$alliwantis = (isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] :
null);
if (!is_null($alliwantis)) {
// Do some stuff
}
echo "You are in $County";
I have tried county county_id and all do everything but display the actual county name? Can anyone please spot what is wrong.
Andrew
I have been trying to display $YouSelected and have used every possible comination. One combination displays the Value and one the same value so they are wroing trying other variables I just get nothing at all. The form posts this:
<form action='./TownsCityCompanies.php' method='POST' name='CountySearch'>
<?
require("connection.php");
mysql_connect("$DBHost", "$DBUser", "$DBPass") or
die("could not connect");
mysql_select_db("$DBName");
echo "<select name=\"CountyID\" size=\"1\" class='menuForm'>";
$result=mysql_query("SELECT County, CountyID FROM county ORDER BY County");
while ($row = mysql_fetch_array($result))
{
$county_id=$row['CountyID'];
$county=$row['County'];
echo "<option value=\"$county_id\"> $county </option>";
}
echo "</select>";
which then gets picked up in this file TownsCityCompanies.php
echo "<select name=\"CountyID\" size=\"1\" class='menuForm'>";
$result=mysql_query("SELECT County, CountyID FROM county ORDER BY County");
while ($row = mysql_fetch_array($result)) {
$county_id=$row['CountyID'];
$county=$row['County'];
echo "<option value=\"$county_id\"";
if ($CountyID == $county_id)
{echo " selected";}
echo "> $county </option>";
}
echo "</select>";
in this file it is this that is causing pain and misery
$alliwantis = (isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] :
null);
if (!is_null($alliwantis)) {
// Do some stuff
}
echo "You are in $County";
I have tried county county_id and all do everything but display the actual county name? Can anyone please spot what is wrong.
Andrew