$SUBMIT - not set or gets no value

wxdqz

New Member
To put this strange problem short:
I have a "custsearch.phtml" and the code looks like this:

"
<body>
<form name="FormName" action="<?php $PHP_SELF ?>" method="get">
<input type="text" name="fr_name" size="16"><input type="submit" name="submit" value=http://www.phpbuilder.com/board/archive/index.php/"Customers">
</form>
</body>
<?php
if (isset($submit) && $submit=="Customers")
{
$con = mysql_connect("localhost","root") or die ("Eroare");
$seldb = mysql_select_db("test",$con);
$query = "select * from activari where nume_client like'%$fr_name%' order by nume_client asc";
$result=mysql_query($query) or die (mysql_error());

while ($row=mysql_fetch_array($result))
{
$mynume = $row["nume_client"];
$mynr_contract = $row["nr_contract_csr"];
$mycust_id = $row["cust_id"];

echo "<b>Name Client:</b> $mynume<br>";
echo "<b>Nr contract CSR:</b> $mynr_contract<br>";
}
}
else
{ echo "Wrong!"; }
?>"


This "if clause" was added to prevent the user going like "http://xserver/custsearch.phtml" and get a hole listing of dbase of about 70.000 items.
The problem is that every time I add the "if clause" I get "Wrong!" message and the query no loger works. The url will look smth like "http://xserver/custsearch.phtml" with no "?fr_name=QueryString&submit=Customers"... So what is wrong??? Please help me understand!
If I just press "Customers" button without entering any string in the input box I will get the whole 70000 items in the databes diplayed on browser!
It looks like the $submit and $fr_name got no values ar are not set!!! WHERE AM I WRONG?

Thx for your patience,
Vik
 
Back
Top