Results 1 to 2 of 2

Thread: คือโค๊ดตรวจเช๊ค email มีปัญหาครับ

  1. #1
    Member
    Join Date
    May 2009
    Location
    thai
    Posts
    45


    <?php

    include("config.inc.php");

    }else{

    $SQL_check_user = "select username from $tbluser where username=&#39;$username&#39;" ;
    $result= mysql_query($SQL_check_user) ;
    $numrow = mysql_num_rows($result) ;
    if($numrow!=0) {

    echo "<table width=550 align=center>";
    echo "<tr> <td align=center bgcolor=#EAECEA>
    ชื่อผู้ใช้ <font color=red>$username</font> นี้มีอยู่ในระบบแล้ว
    ";
    echo "กลับไปแก้ไข";
    echo "</td></tr>";
    echo "</table>";
    exit() ;
    }
    else if (check_email($email)){

    if($password<>$confirm_pass){

    echo"<table width=550 align=center>";
    echo "<tr> <td align=center bgcolor=#EAECEA>
    รหัสผ่านไม่ตรงกันแก้ไขใหม่ครับ
    ";
    echo "กลับไปแก้ไข

    ";
    echo "</td></tr>";
    echo "</table>";
    exit() ;

    }

    else {
    $date_register=date(&#39;l F d, Y&#39;
    $SQL_insert_member="insert into $tbluser (name, email, username, password, date, status) values (&#39;$name&#39;, &#39;$email&#39;, &#39;$username&#39;, &#39;$password&#39;, &#39;$date_register&#39;, &#39;0&#39";
    mysql_db_query($db,$SQL_insert_member);
    echo"<table width=550 align=center>";
    echo"<tr> <td align=center bgcolor=#EAECEA>[b]เพิ่มข้อมูลของคุณ <font color=red>$name</font> เรียบร้อยแล้วครับ</a></td></tr>";
    echo"<tr> <td align=center>
    กรุณารอผู้ดูแลระบบ ตรวจสอบข้อมูลของคุณ <font color=red>$name</font>
    ";
    echo"หลังจากนั้นทางผู้ดูแลระบบได้<font color=red> Active </font>สถานะของคุณแล้ว จะดำเนินการ
    ";
    echo"ติดต่อกลับทางอีเมล์ โดยให้คุณนำเอา้<font color=red> ชื่อเข้าระบบ และ รหัสผ่าน</font>
    ";
    echo"ที่คุณสมัครไว้ มาใช้เข้าระบบได้ทันที

    </td></tr>";
    echo"<tr> <td align=center>";
    echo "<font color=red>การส่งเมล์แจ้งเตือน Administrator</font>
    ";


    $html = "<html>";

    $html .= "<head><title>สมาชิก</title></head>";

    $html .= "<body>";

    $html .= "มีสมาชิกมาใหม่โปรดกรุณาตรวจข้อมูล
    ";

    $html .= "ชื่อสมาชิก : $name
    ";

    $html .= "ชื่อเข้าระบบ : $username
    ";

    $html .= "รหัสผ่าน : $password
    ";

    $html .= "อีเมล์ที่ใช้ในการสมัคร :$email
    ";

    $html .= "วันที่สมัคร : $date_register
    ";

    $html .= "สถานะ : รอตรวจสอบ
    ";

    $html .= "</body>";

    $html .= "</html>";

    $boundary = uniqid("");


    $header = "From: $email\n";

    $header .= "Content-type: multipart/mixed; boundary=\"$boundary\"\n";


    $body = "--$boundary\n";

    $body .= "Content-type: text/html; charset=windows-874;\n";

    $body .= "Content-disposition: inline;\n";

    $body .= "Content-transfer-encoding: 8bit\n\n";

    $body .= "$html\n";

    $body .= "--$boundary--\n";

    if (mail($admin_mail, $subject_new_user, $body, $header)) {


    echo"ส่งอีเมล์แจ้งถึงผู้ดูแลระบบให้ตรวจสอบข้อมูลงของคุณ<font color=red> $name </font> เรียบร้อยแล้วครับ";

    }
    else {


    echo "ส่งเมล์แจ้งข้อมูลถึงผู้ดูแลระบบไม่ได้";


    }


    echo"</td></tr>";
    echo"<tr> <td align=center bgcolor=#EAECEA>ปิดหน้านี้</td></tr>";
    echo"</table>";
    mysql_close();

    }

    }else{

    echo"<table width=550 align=center>";
    echo"<tr> <td align=center bgcolor=#EAECEA>
    [b]";
    echo "รูปแบบ Email ที่คุณป้อนมารูปแบบ<font color=red>ไม่ถูกต้องครับ</font>
    ";
    echo "กลับไปแก้ไข";
    echo "

    </td></tr>";
    echo"</table>";
    exit() ;

    }
    }

    ?>

    อผมไม่เข้าใจครับว่ามันเกิดการฟ้องว่า error line 5ครับ โดยที่ผมจะต้องการ ใช้ form regis ที่เคยถามดึงinclude ไฟล์นี้ไปทํางานครับ แต่ ขอถามอีกนะครับการที่จะใส่popup ให้เป็นการแจ้งเตือนได้ไหมถ้าได้ขอวิธีการหน่อยหรือว่าเราต้องทําไฟล์แย่งออกมาอีก เพราะผมมีform แต่ต้องการinclude ไฟล์ส่วนนี้ ไปร่วมทํางาน และการให้ไฟล์นี้ include ไฟล์ส่วนของที่จะติดต่อกับฐานข้อมูลmysql เลยทําให้ไม่เข้าใจมากเพระว่าผมต้องทําโปรเจคจบครับ

  2. #2
    Senior Member retool2's Avatar
    Join Date
    Aug 2008
    Location
    Under Relocation
    Posts
    178


    include("config.inc.php");
    }else{
    $SQL_check_user = "select username from $tbluser where username=&#39;$username&#39;" ;
    $result= mysql_query($SQL_check_user) ;

    ผมว่ามีปัญหาแค่ตรงนี้แหละครับ ผมไม่รู้รายละเอียดว่ามีไฟล์อะไรอีกบ้างนะครับ
    เดาจากรายละเอียกคร่าวๆแล้วคิดว่าไม่มีไฟล์ config.inc.php sรือว่าอาจจะมีหรือว่าข้อมูลข้างในไม่ถูกก็ไม่ทราบ
    อาจจะไม่มี ๓ะิสีหำพ หรือว่าอาจจะไม่มีส่วน connect DB ก็ได้

Similar Threads

  1. Replies: 3
    Last Post: 10-06-2008, 10:46 PM
  2. Search มีปัญหาครับ ช่วยดูให้ทีครับ
    By pspn.n in forum แจ้งปัญหาการใช้งานบอร์ด
    Replies: 3
    Last Post: 26-03-2008, 08:46 AM
  3. Replies: 0
    Last Post: 04-11-2006, 11:46 PM
  4. windows XP มีปัญหาครับ
    By lidkun in forum Operating System, Server and Networking
    Replies: 2
    Last Post: 04-01-2005, 12:37 PM
  5. ภัย SPAM Email และ Malicious Email content
    By Amine in forum Non computer knowledge
    Replies: 0
    Last Post: 01-01-1970, 07:00 AM

Members who have read this thread : 0

Actions : (View-Readers)

There are no names to display.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •