|
 |
|
ดูโค้ดให้หน่อยสิค่ะไม่ไหวแล้ว...โค้ดนี้ต้องการให้ขึ้นerror ถ้ายังไม่มีพิมพ์อะไรลงไป ค่ะช่วยหน่อยน่ะค่ะด่วยมากจะส่งงานแล้วอ่ะ |
|
 |
|
|
 |
 |
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>Untitled Document</title>
</head>
<body bgcolor="#FFFFFF">
<?
$user_reg=$_POST[user_reg];
$pass_reg=$_POST[pass_reg];
$name_reg=$_POST[name_reg];
$age_reg=$_POST[age_reg];
$sex_reg=$_POST[sex_reg];
$email_reg=$_POST[email_reg];
$address_reg=$_POST[address_reg];
$date_reg=date("Y-m-d");
if($user_reg ==" " or $pass_reg ==" " or $name_reg == " " ){
echo"<h3>ERROR : กรุณากรอกข้อมูลให้ครบนะค่ะ<h3>"; exit();
}
include "function.php";
if(checkemail($email_reg) ) {
echo "<h3>ERROR : รูปแบบอีเมลไม่ถูกต้องนะค่ะ</h3>"; exit();
}
include "connect.php";
$sql="select * from tb_member where username='user_reg' ";
$result=mysql_db_query($dbname,$sql);
$num=mysql_num_rows ($result);
if($num>0){
echo "<h3>ERROR : Usernameซ้ำค่ะ </h3>"; exit();
}
$sql="insert into tb_member values(' ','$user_reg','$pass_reg','$name_reg','$age_reg', '$sex_reg','$email_reg','$tel_reg','$address_reg','$date_reg')";
$result=mysql_db_query($dbname,$sql);
if($result){
echo "<h3>ข้อมูลของท่านถูกต้องบันทึกเรียบร้อยแล้ว</h3>";
echo "<a href='member.php'>คลิกเพื่อเข้าระบบสมาชิก></a><br><br>";
}else{
echo "<h3>ไม่สามารถสมัครเป็นสมาชิกได้</h3>";
}
mysql_close();
?>
</body>
</html>
โค้ดนี้ต้องการให้ขึ้นerror
ถ้ายังไม่มีพิมพ์อะไรลงไป
ค่ะช่วยหน่อยน่ะค่ะด่วยมากจะส่งงานแล้วอ่ะ
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-04-17 16:29:08 |
By :
hui |
View :
986 |
Reply :
13 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
https://www.thaicreate.com/php/forum/026364.html
ตอบให้แล้วครับ
|
 |
 |
 |
 |
Date :
2009-04-17 16:36:20 |
By :
kanchen |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>Untitled Document</title>
</head>
<body bgcolor="#FFFFFF">
<?
$user_reg=$_POST[user_reg];
$pass_reg=$_POST[pass_reg];
$name_reg=$_POST[name_reg];
$age_reg=$_POST[age_reg];
$sex_reg=$_POST[sex_reg];
$email_reg=$_POST[email_reg];
$address_reg=$_POST[address_reg];
$date_reg=date("Y-m-d");
if($user_reg=="" || $pass_reg=="" || $name_reg=="") {
echo"<table width=70% align=center bgcolor='#FFFFFF' class=ContentList'>";
echo "<tr> <td align=center bgcolor=#EAECEA><br<font color=red>คุณกรอกข้อมูลไม่ครบ !</font> <br>";
echo "<a href=javascript:history.back(-1); >กลับไปแก้ไข</a>";
echo "</td></tr>";
echo "</table>";
exit();
} else if (!ereg("^.+@.+\..+$",$email_reg)) {
echo"<table width=70% align=center bgcolor='#FFFFFF' class=ContentList'>";
echo "<tr> <td align=center bgcolor=#EAECEA><br>";
echo "กรุณาระบุรูปแบบ Email ให้ถูกต้องด้วยค่ะ <br />";
echo "ตัวอย่าง [email protected] เป็นต้น<br />";
echo "<a href=javascript:history.back(-1); >กลับไปแก้ไข</a>";
echo "</td></tr>";
echo "</table>";
exit();
}
/* include "function.php";
if(checkemail($email_reg) ) {
echo "<h3>ERROR : รูปแบบอีเมลไม่ถูกต้องนะค่ะ</h3>"; exit();
} */
include "connect.php";
$sql="select * from tb_member where username='user_reg' ";
$result=mysql_db_query($dbname,$sql);
$num=mysql_num_rows ($result);
if($num>0){
echo "<h3>ERROR : Usernameซ้ำค่ะ </h3>"; exit();
}
$sql="insert into tb_member values(' ','$user_reg','$pass_reg','$name_reg','$age_reg', '$sex_reg','$email_reg','$tel_reg','$address_reg','$date_reg')";
$result=mysql_db_query($dbname,$sql);
if($result){
echo "<h3>ข้อมูลของท่านถูกต้องบันทึกเรียบร้อยแล้ว</h3>";
echo "<a href='member.php'>คลิกเพื่อเข้าระบบสมาชิก></a><br><br>";
}else{
echo "<h3>ไม่สามารถสมัครเป็นสมาชิกได้</h3>";
}
mysql_close();
?>
</body>
</html>
อย่างนี้หรอที่อยากได้
|
 |
 |
 |
 |
Date :
2009-04-17 16:39:34 |
By :
pokultra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณน่ะค่ะ
|
 |
 |
 |
 |
Date :
2009-04-17 16:41:22 |
By :
hui |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แก้ไขนิด
Code (PHP)
<?php
$user_reg=$_POST[user_reg];
$pass_reg=$_POST[pass_reg];
$name_reg=$_POST[name_reg];
$age_reg=$_POST[age_reg];
$sex_reg=$_POST[sex_reg];
$email_reg=$_POST[email_reg];
$address_reg=$_POST[address_reg];
$date_reg=date("Y-m-d");
if($user_reg=="" || $pass_reg=="" || $name_reg=="") {
echo"<table width=70% align=center bgcolor='#FFFFFF'>";
echo "<tr> <td align=center bgcolor=#EAECEA><br<font color=red>คุณกรอกข้อมูลไม่ครบ !</font> <br>";
echo "<a href=javascript:history.back(-1); >กลับไปแก้ไข</a>";
echo "</td></tr>";
echo "</table>";
exit();
} else if (!ereg("^.+@.+\..+$",$email_reg)) {
echo"<table width=70% align=center bgcolor='#FFFFFF'>";
echo "<tr> <td align=center bgcolor=#EAECEA><br>";
echo "กรุณาระบุรูปแบบ Email ให้ถูกต้องด้วยค่ะ <br />";
echo "ตัวอย่าง [email protected] เป็นต้น<br />";
echo "<a href=javascript:history.back(-1); >กลับไปแก้ไข</a>";
echo "</td></tr>";
echo "</table>";
exit();
}
/* include "function.php";
if(checkemail($email_reg) ) {
echo "<h3>ERROR : รูปแบบอีเมลไม่ถูกต้องนะค่ะ</h3>"; exit();
} */
include "connect.php";
$sql="select * from tb_member where username='user_reg' ";
$result=mysql_db_query($dbname,$sql);
$num=mysql_num_rows ($result);
if($num>0){
echo "<h3>ERROR : Usernameซ้ำค่ะ </h3>"; exit();
}
$sql="insert into tb_member values(' ','$user_reg','$pass_reg','$name_reg','$age_reg','$sex_reg','$email_reg','$tel_reg','$address_reg','$date_reg')";
$result=mysql_db_query($dbname,$sql);
if($result){
echo "<h3>ข้อมูลของท่านถูกต้องบันทึกเรียบร้อยแล้ว</h3>";
echo "<a href='member.php'>คลิกเพื่อเข้าระบบสมาชิก></a><br><br>";
}else{
echo "<h3>ไม่สามารถสมัครเป็นสมาชิกได้</h3>";
}
mysql_close();
?>
|
 |
 |
 |
 |
Date :
2009-04-17 16:50:47 |
By :
pokultra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณน่ะค่ะคุณpokultra
ที่ส่งโค้ดมาให้
ถูกต้องเลยค่ะที่ต้องการ
ขอบคุณมากๆๆน่ะค่ะมีอีกหลายหน้าที่ให้ช่วยค่ะ
|
 |
 |
 |
 |
Date :
2009-04-17 16:50:58 |
By :
hui |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
555
|
 |
 |
 |
 |
Date :
2009-04-17 16:51:36 |
By :
pokultra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณน่ะค่ะคุณpokultra
มีอีเมลหรือเปล่าค่ะ
เพื่อถามอย่างอื่นอีก
เพื่อคุณไม่ได้เข้ามาตอบค่ะ
|
 |
 |
 |
 |
Date :
2009-04-17 17:00:50 |
By :
hui |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
pokultra(at)hotmail.com
ยินดีครับ เท่าที่ทำได้
|
 |
 |
 |
 |
Date :
2009-04-17 17:06:30 |
By :
pokultra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เธอUsernameซ้ำมันไม่ขึ้นerrorอ่ะค่ะ
รบกวนอีกที่
|
 |
 |
 |
 |
Date :
2009-04-17 17:11:22 |
By :
hui |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากน่ะค่ะทุกๆๆคนเลยที่ให้ความช่วยเหลือเป็นอย่างดีค่ะ
ขอบคุณมากๆๆน่ะค่ะ 
|
 |
 |
 |
 |
Date :
2009-04-17 17:39:45 |
By :
hui |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เป็นงัยบ้างครับ เรียบร้อยแล้วเนอะ
พอดีเลิกงานแล้วกับบ้านเร็วน่ะ
อิอิ เลยไม่ทันได้ดูต่อ
|
 |
 |
 |
 |
Date :
2009-04-18 08:19:19 |
By :
pokultra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|