|
 |
|
รบกวนดู โค้ด เรื่อง session หนอ่ยครับ ลองรันดูแล้ว บอกว่ามี ปัญหา LINE 13 14 มีวิธีการเก็บลง db ยังงัยครับ |
|
 |
|
|
 |
 |
|
Code (PHP)
<?php
session_start() ;
include("config.inc.php") ;
mysql_select_db($db) ;
// ตรวจสอบว่ามีชื่อ user นี้ใช้ไปหรือยัง
$sql = "select user from member where user='$user_name'" ;
$result = mysql_query($sql) ;
$numrow = mysql_num_rows($result) ;
if($numrow!=0) {
echo "<br><br><center><font size='3' face='MS Sans Serif'>ขอโทษด้วยครับ user $user_name นี้ ได้มีผู้ใช้ไปแล้วครับ กรุณาเปลี่ยนชื่อ Login ใหม่" ;
echo "<br><br><input type='button' value='back to edit' onclick='history.back();'></center>" ;
exit() ;
}
// ถ้ายังไม่มีผู้ใช้ชื่อ user นี้
$sql = "select * from member order by id desc" ;
$result = mysql_query($sql) ;
$num_result = mysql_num_rows($result) ;
$dbarr = mysql_fetch_row($result) ;
$user = session("user_name")
$password = session("pwd_name1")
$email = session("email")
$signup = date("j/n/").(date("Y")+543) ;// วันที่ register
$result = mysql_query("INSERT INTO member (user,password,email,staff_id,site,name_th,name_en,pic,about_us,status,age,date,month,year,address,amper,province,zipcode,phone,education,school,major,op_rom,pasa,position,level,y_work,dep,sec,division,vision,signup)
values('$user_name','$pwd_name1','$email','$staff_id','$site','$name_th','$name_en','$pic','$about_us','$status','$age','$date','$month','$year','$address','$amper','$province','$zipcode','$phone','$education','$school','$major','$op_rom','$pasa','$position','$level','$y_work','$dep','$sec','$devision','$vision','$signup')") or die("ผิด insert");
if(result) {
$login_true = $user_name ;
session_register("login_true") ;
echo "<meta http-equiv='refresh' content='4; url=home.php'>" ;
}
?>
ลองรันดูแล้ว บอกว่ามี ปัญหา LINE 13 14 มีวิธีการเก็บลง db ยังงัยครับ
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-07-15 18:33:07 |
By :
aakkeng |
View :
1124 |
Reply :
5 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มัน error บรรทัด 14 ครับ
|
 |
 |
 |
 |
Date :
2009-07-15 18:35:12 |
By :
aakkeng |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้าเอา exit(); ออกหรือเปลี่ยนเป็น break; จะหายมั้ยครับ?
|
 |
 |
 |
 |
Date :
2009-07-15 19:04:41 |
By :
mr.v |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตรง values ใช้ " แทนครับ ไม่ก็เอา ' ออก
แบบนั้นค่าตัวแปรไม่ออกคับ
|
 |
 |
 |
 |
Date :
2009-07-15 19:46:38 |
By :
pjgunner |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มันฟ้องบรรทักที่ 23 24 25 ครับผม
|
 |
 |
 |
 |
Date :
2009-07-16 08:38:35 |
By :
aakkeng |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตรงvalues ที่ INSERT INTO ตัวไหนเซตเป็นตัวเลขint (มีรึเปล่าหว่า) เราจะไม่ใส่ $ นะคะ
|
 |
 |
 |
 |
Date :
2009-07-16 11:07:41 |
By :
SG14 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|