PHP: if (isset(x)) problem

by Martin =?iso-8859-1?q?Skj=F6ldebrand?= <chimbis(at)skjoldebrand.org>

 Date:  Thu, 8 Mar 2001 05:36:38 +0100
 To:  hwg-languages(at)hwg.org
  todo: View Thread, Original
I'm going completely bonkers over this. Any suggestions appreciated. 
I'm a newbie at PHP/MySQL so I'm not sure what I'm doing wrong here. Below is 
the end of a routine I'm hacking which will modify client info (I've managed 
ADD and REMOVE and displaying data in the form below works). Clicking the 
submit button (name cmdFinish) doesn't make the routine go on to update the 
database, it just moves back to the start of Modify Client without updating 
the database.

What am I missing?

8< -------------- code --------------------->8

<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;
         }

?>

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA