home *** CD-ROM | disk | FTP | other *** search
/ csi.uticak12.org / csi.uticak12.org.tar / csi.uticak12.org / back / form.php < prev    next >
PHP Script  |  2011-10-20  |  1KB  |  49 lines

  1. <?
  2. include 'guard.php';
  3. mysql_connect(HostName,UserName,Password) or die("<html><body>Can not connect to MySql server!<br></body></html>");
  4. mysql_select_db (DBName) or die ("<html><body>Could not select database ".DBName."<br></body></html>");
  5.  
  6. if ($act=='1') {
  7. $femail=addslashes($femail);
  8. $res=mysql_query("UPDATE `gal_form` SET `email`='$femail'") or die (mysql_error());
  9.  
  10. $error='The settings are updated!';
  11. } else {
  12. $res=mysql_query("SELECT * FROM `gal_form`") or die (mysql_error());
  13. $f=mysql_fetch_array($res);
  14. $femail=stripslashes($f['email']);
  15. };
  16. ?>
  17.  
  18. <?    $header = "Contact Form Settings";
  19.     include ('top.inc'); ?>
  20.  
  21.  
  22. <h1 align="center"><?=$error?></h1>
  23.  
  24. <form action="form.php" method="post" name="form1" ENCTYPE="multipart/form-data">
  25. <table border=0 cellspacing=0 cellpadding=5 align=center width="100%">
  26.     <tr>
  27.         <td class="border">
  28.             <table border=0 cellspacing=1 cellpadding=5 width="100%" class="back">
  29.                 <tr>
  30.                     <td class="th" colspan=2><p align="center">Details</p></td>
  31.                 </tr>
  32.                 <tr>
  33.                     <td class="odd" align=right width="40%"><b>Email:</b></td>
  34.                     <td class="odd"><input type="text" name="femail" value="<?=$femail?>" class="inp" size="60"></td>
  35.                 </tr>
  36.                 <tr>
  37.                     <td class="tf" align=center colspan=2>
  38.                     <input type=submit class="btn" value="Save changes"> 
  39.                     </td>
  40.                 </tr>
  41.             </table>
  42.         </td>
  43.     </tr>
  44. </table>
  45.  
  46. <input type="hidden" name="act" value="1">
  47. </form>
  48.  
  49. <? include ('btm.inc'); ?>