home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
csi.uticak12.org
/
csi.uticak12.org.tar
/
csi.uticak12.org
/
back
/
student.php
< prev
next >
Wrap
PHP Script
|
2011-10-20
|
2KB
|
55 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') {
$flogin=addslashes($flogin);
$fpassword=addslashes($fpassword);
$res=mysql_query("UPDATE `gal_student` SET `login`='$flogin', `password`='$fpassword'") or die (mysql_error());
$error='The settings are updated!';
} else {
$res=mysql_query("SELECT * FROM `gal_student`") or die (mysql_error());
$f=mysql_fetch_array($res);
$flogin=stripslashes($f['login']);
$fpassword=stripslashes($f['password']);
};
?>
<? $header = "Student Login";
include ('top.inc'); ?>
<h1 align="center"><?=$error?></h1>
<form action="student.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>Login:</b></td>
<td class="odd"><input type="text" name="flogin" value="<?=$flogin?>" class="inp" size="60"></td>
</tr>
<tr>
<td class="even" align=right width="40%"><b>Password:</b></td>
<td class="even"><input type="text" name="fpassword" value="<?=$fpassword?>" 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'); ?>