[prev in list] [next in list] [prev in thread] [next in thread]
List: php-general
Subject: [PHP] Value of if(isset(X)) problem
From: Martin =?ISO-8859-1?Q?Skj=F6ldebrand?= <chimbis () skjoldebrand ! org>
Date: 2001-03-07 5:33:46
[Download RAW message or body]
Sorry bout the length .... I'm a newbie to PHP/MySQL so bare with me ...
Here's a snippet of an app I'm hacking. I have a form that should update a
client form. the cl_XXXX are taken from a database table and works nicely.
The point of this that they should possibly be replaced by txtXXX and put
back in the table.
As far as I can tell this _should_ work but it doesn't. I suspect that
cmdFinish is never set if (isset($cmdFinish)) isn't true ....
Any suggestions?
8< ------------- code -------------------------->8
<tr>
<td width="50%" valign=center align=right>Computer ID:
</td>
<td width="50%">
<input type=text name="txtCompID" size=10 value = "<?echo
$cl_compID?>">
</td>
</tr>
<tr>
<td width="50%" valign=center align=right>
<font size=3>Email:</font>
</td>
<td width="50%">
<input type=text name="txtEmail" size=20 value = "<?echo
$cl_email?>">
</td>
</tr>
</table>
<p align=center>
<center>
<input type="submit" value="Modify client" name="cmdFinish">
</td>
</center>
</tr>
</table>
</center>
</div>
</form>
<?php //OK we can commit our changes ...
if (isset($cmdFinish)) {
$query = "UPDATE client SET ";
$query .= "cl_login ='$txtLogin', ";
$query .= "cl_firstname ='$txtFirstname', ";
$query .= "cl_secondname ='$txtSecondname', ";
$query .= "cl_phone = '$txtPhone', ";
$query .= "cl_type = '$txtType', ";
$query .= "cl_dept = '$txtDept', ";
$query .= "cl_compID = '$txtCompID', ";
$query .= "cl_email = '$txtEmail' ";
$query .= "WHERE cl_login = '$lstModifyClient';";
$mysql_result = mysql_query($query, $mysql_link);
print "<CENTER><BR><BR>\n";
print "$txtLogin has been successfully modified!<BR><BR></CENTER>\n";
exit;
}
?>
<? }
else {
print "<CENTER><BR><BR><B>The Client: </B>$lstModifyClient has ";
print "<b>not</b> been modified<BR></CENTER>\n";
}
}
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic