ช่วยดู โค้ดให้หน่อยครับมันไม่โชว์อะไรเลย ผมต้องแก้ตรงไหนมั้งครับ
regis.php
<?
include("library.php");
if(!empty($cancel))
{
header("http:member.php?errmsg=$errmsg");
}
if(!empty($ok))
{
$errmsg = $errmsg.validate($username,"Username :",0,0,1,0,1);
$errmsg = $errmsg.validate($pass,"Password :");
if (empty($errmsg))
{
$insertsql = "insert into user
(
username,
pass,
)
value
(
'$username',
'$pass',
)";
$insertsqlres = mysql_query($insertsql) or die (mysql_error());
$errmsg="อัพเดทข้อมูลเรียนร้อยแล้ว";
header("member.php?errmsg=$errmsg");
}
}
?>
<tr>
<?php
if (!empty($errmsg))
{
print"<td align='center' colspan='2' class='warningval'>";
print"<b>Validation fails due to:</b><br>";
print $errmsg;
print"<br></td>";
}
?>
</tr>
<tr><form>
<td align="right"><B>Username :</B></td><td align="left"><input type="text" maxlength="20" name="username" value="<?php print $username;?>"></td>
</tr>
<tr>
<td align="right"><B>Password :</B></td><td align="left"><input type="password" maxlength="20" name="pass" value="<?php print $pass;?>"></td>
</tr>
<tr>
<td align="center" colspan="2"><input type="submit" name="ok" value="ตกลง"> <input type="submit" name="cancel" value="ยกเลิก"></td>
</form></tr>
library.php
<?
function validate($text,$fieldname,$check_text=0,$check_num=0,$textvalidate=0,$texthave="",$textno="",$textminlength=0,$textmaxlength=0,$nummin=0,$nummax=0)
{
if (empty($text))
{
$errmsg = "$fieldname ยังไม่ได้กรอกข้อมูล <br>";
}
else
{
........................
?>
Tag : - - - -
Date :
2010-05-02 18:04:47
By :
love
View :
771
Reply :
1
Load balance : Server 01