Value of if(isset(X)) problem

From: Date: Wed, 07 Mar 2001 05:33:46 +0000
Subject: Value of if(isset(X)) problem
Groups: php.general 
Request: Send a blank email to php-general+get-42855@lists.php.net to get a copy of this message
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"; } } ?>

« previous php.general (#42855) next »