Problem with Form
Posted: Tue Jul 01, 2003 9:34 pm
You win the award for most annoying cross-posting ever (5 total).
Please don't do it again.
Hi everyone!!
I am having problem with HTML FORM and PHP implementation. In my following code I am always gettimg the output for "Hello" For some reason my if (!$Submit) is not working. And when I do not use this condition I get the check box out put but that does not help me anyway because I want activate my Delete button so that I can delete the items selected from checkbix. Can you help me? Thank you.

Hi everyone!!
I am having problem with HTML FORM and PHP implementation. In my following code I am always gettimg the output for "Hello" For some reason my if (!$Submit) is not working. And when I do not use this condition I get the check box out put but that does not help me anyway because I want activate my Delete button so that I can delete the items selected from checkbix. Can you help me? Thank you.
Code: Select all
<form action = "SendDomainName.php" Method = "GET">
<?php
require("......");
$link = mysql_connect($host,$user,$pass);
if (!$link)
die("Couldn't connect to MySQL");
mysql_select_db($db)
or die("Couldn't open $db: ".mysql_error());
if (!$submit)
{
if (isset($_POSTї'DomainMenu']))
{
$table = "DomainEquivalence";
$val = $_POSTї'DomainMenu'];
if($val != '')
{
$result = mysql_query("SELECT First FROM $table where Name = '". $_POSTї'DomainMenu'] ."'");
if (!$result)
{
print "Query Failed: " .mysql_error();
}
else
{
$Next_ID = mysql_result($result, 0, 'First');
print "<br> Select any of the following Domain for deletion from $val :<p>";
while($Next_ID != NULL)
{
$table = "DomainEquivalentList";
$result = mysql_query("SELECT Domain_ID, Next_ID from $table where DomainEquivalentList_ID= $Next_ID");
$Next_ID = mysql_result($result,0,'Next_ID');
$Domain_ID = mysql_result($result,0,'Domain_ID');
$table = "Domain";
$result = mysql_query("SELECT Name from $table where Domain_ID = $Domain_ID");
$Domain_Name = mysql_result($result,0,'Name');
?>
<INPUT TYPE="checkbox" NAME="Nameї]" VALUE="<?php echo $Domain_Name;?>">
<?php
print "$Domain_Name<br>";
}
?>
<input type="submit" value="Delete" name="submit">
<input type = "reset" value = "Reset" name = "reset">
</form>
<?php
}
}
else
print "Plese Select a Domain and try again";
}
}
else if ($submit)
print "Hello";
mysql_close($link);
?>