home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
csi.uticak12.org
/
csi.uticak12.org.tar
/
csi.uticak12.org
/
back
/
form.php
< prev
next >
Wrap
PHP Script
|
2011-10-20
|
1KB
|
49 lines
<?
include 'guard.php';
mysql_connect(HostName,UserName,Password) or die("<html><body>Can not connect to MySql server!<br></body></html>");
mysql_select_db (DBName) or die ("<html><body>Could not select database ".DBName."<br></body></html>");
if ($act=='1') {
$femail=addslashes($femail);
$res=mysql_query("UPDATE `gal_form` SET `email`='$femail'") or die (mysql_error());
$error='The settings are updated!';
} else {
$res=mysql_query("SELECT * FROM `gal_form`") or die (mysql_error());
$f=mysql_fetch_array($res);
$femail=stripslashes($f['email']);
};
?>
<? $header = "Contact Form Settings";
include ('top.inc'); ?>
<h1 align="center"><?=$error?></h1>
<form action="form.php" method="post" name="form1" ENCTYPE="multipart/form-data">
<table border=0 cellspacing=0 cellpadding=5 align=center width="100%">
<tr>
<td class="border">
<table border=0 cellspacing=1 cellpadding=5 width="100%" class="back">
<tr>
<td class="th" colspan=2><p align="center">Details</p></td>
</tr>
<tr>
<td class="odd" align=right width="40%"><b>Email:</b></td>
<td class="odd"><input type="text" name="femail" value="<?=$femail?>" class="inp" size="60"></td>
</tr>
<tr>
<td class="tf" align=center colspan=2>
<input type=submit class="btn" value="Save changes">
</td>
</tr>
</table>
</td>
</tr>
</table>
<input type="hidden" name="act" value="1">
</form>
<? include ('btm.inc'); ?>