Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > ขอถามผู้รู้หน่อยครับมีโค๊ตมาให้ช่วยแก้หน่อยนะครับใครช่วยได้บอกทีงานชิ้นสุดท้าย



 

ขอถามผู้รู้หน่อยครับมีโค๊ตมาให้ช่วยแก้หน่อยนะครับใครช่วยได้บอกทีงานชิ้นสุดท้าย

 



Topic : 071219



โพสกระทู้ ( 68 )
บทความ ( 0 )



สถานะออฟไลน์




อันนี้คือcodeหน้าให้กรอกข้อมูล
Code (PHP)
<?php

session_start(); 

ob_start();

if($_SESSION['admin_id'] == "") 
{ 
        
echo "Please Login!"; 
?>

<meta http-equiv="refresh" content="1;URL=../../../login/login.php">
<?
exit(); 

} 
 
?>

<!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=utf-8" />
<title>ลงทะเบียนผู้ใช้ระบบทั่วไป</title>
<style type="text/css">
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
</style>

</head>

<body  bgcolor="#999999">


<script type="text/javascript" src="../../../../ckeditor/ckeditor.js"></script>

<script src="../../../../ckeditor/_samples/sample.js" type="text/javascript"></script>
<link href="../../../../ckeditor/_samples/sample.css" rel="stylesheet" type="text/css" />

</table>
<form id="form1" name="checkForm" method="post" action="chkregister_user.php">
<table width="50%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td><img src="../../../../image/header.jpg" width="950" height="250" /></td>
        </tr>
        <tr>
          <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td background="../../../../image/Index1_03.png"><table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="32"><a href="../../user/show_user.php">ย้อนกลับ</a></td>
    <td align="left">&nbsp;</td>
  </tr>
</table>
</td>
            </tr>
          </table></td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFCC">
        <tr >
          <td height="476" valign="top" ><table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td height="476" align="center" valign="top"><br />
                <table width="80%" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000">
                <tr>
                  <td><table width="100%" border="0" cellpadding="1" cellspacing="1">
                    <tr>
                      <td height="34" colspan="2" align="center" bgcolor="#F2B672"><strong>ระบบการสมัครสมาชิกผู้เข้าใช้ระบบทั่วไป</strong></td>
                      </tr>
                    <tr>
                      <td width="23%" height="31" align="left" bgcolor="#FFFFFF"><strong>&nbsp;&nbsp;ชื่อ-นามสกุล</strong></td>
                      <td width="77%" align="left" bgcolor="#FFFFFF"><input name="re_name" type="text" id="re_name" size="30" />
                        *</td>
                    </tr>
                    <tr>
                      <td height="31" align="left" bgcolor="#FFFFFF"><strong>&nbsp;&nbsp;รหัสบัตรประชาชน</strong></td>
                      <td align="left" bgcolor="#FFFFFF"><input name="re_id_no" type="text" id="re_id_no" size="30" maxlength="13" />
*xxxxxxxxxxxxx</td>
                    </tr>
                    <tr>
                      <td height="32" align="left" bgcolor="#FFFFFF"><strong>&nbsp;&nbsp;ที่อยู่</strong></td>
                      <td align="left" bgcolor="#FFFFFF"><textarea name="re_address"  class="ckeditor"  cols="30" rows="5" id="re_address"><?=$_POST['re_address']?>
                      </textarea>
*</td>

<script type="text/javascript" >


			CKEDITOR.replace( 're_address',
				{
					//toolbar : 'Full',
					toolbar :
        [
            ['Source','-','Templates'],
            ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
            ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
            ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],

        ],
					width  : 600,
					extraPlugins: 'uicolor',
					uiColor : '#99CCFF',
		
			filebrowserBrowseUrl : '../../../../ckfinder/ckfinder.html',
            filebrowserImageBrowseUrl : '../../../../ckfinder/ckfinder.html?Type=Images',
            filebrowserFlashBrowseUrl : '../../../../ckfinder/ckfinder.html?Type=Flash',
            filebrowserUploadUrl : '../../../../ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
            filebrowserImageUploadUrl : '../../../../ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
            filebrowserFlashUploadUrl : '../../../../ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
				});
		</script>
                    </tr>
                    <tr>
                      <td height="30" align="left" bgcolor="#FFFFFF"><strong>&nbsp;&nbsp;เบอร์โทร</strong></td>
                      <td align="left" bgcolor="#FFFFFF"><input name="re_phone" type="text" id="re_phone" size="30" maxlength="11" />
*
          xxx-xxxxxxx</td>
                    </tr>
                    <tr>
                      <td height="30" align="left" bgcolor="#FFFFFF"><strong>&nbsp;&nbsp;อีเมล์</strong></td>
                      <td align="left" bgcolor="#FFFFFF"><input name="re_email" type="text" id="re_email" size="30" />
*</td>
                    </tr>
                    <tr>
                      <td height="30" align="left" bgcolor="#FFFFFF"><strong>&nbsp;&nbsp;ชื่อผู้เข้าใช้</strong></td>
                      <td align="left" bgcolor="#FFFFFF"><input name="re_user" type="text" id="re_user" size="30" maxlength="50" />
*</td>
                    </tr>
                    <tr>
                      <td height="30" align="left" bgcolor="#FFFFFF"><strong>&nbsp;&nbsp;รหัสผ่าน</strong></td>
                      <td align="left" bgcolor="#FFFFFF"><input name="re_pass" type="password" id="re_pass" size="30" maxlength="50" />
*</td>
                    </tr>
                    <tr>
                      <td height="33" align="left" bgcolor="#FFFFFF"><strong>&nbsp;&nbsp;ยืนยันรหัสผ่าน</strong></td>
                      <td align="left" bgcolor="#FFFFFF"><input name="re_pass1" type="password" id="re_pass1" size="30" maxlength="50" />
*</td>
                    </tr>
                    <tr>
                      <td colspan="2" align="center" bgcolor="#FFFFFF"><input type="submit" name="Submit" id="Submit" value="สมัครสมาชิก" />
                        <input type="submit" name="button2" id="button2" value="ยกเลิก" />
                        <input name="ok" type="hidden" id="ok" value="ok_pass" /></td>
                      </tr>
                  </table></td>
                </tr>
              </table>
                <br /></td>
              </tr>
          </table>                                      </td>
          </tr>
      </table></td>
    </tr>
    <tr>
      <td align="center"><img src="../../../../image/footer.PNG" width="950" height="101" /></td>
    </tr>
  </table>
</form>
</body>
</html>




และนี่คือโค๊ตเช็ค

Code (PHP)
<?php 


/* add by kergrit(redthird.com) for compatible global variable off/on php.ini */
$re_name = $_POST['re_name'];
$re_id_no = $_POST['re_id_no'];
$re_address = $_POST['re_address'];
$re_phone = $_POST['re_phone'];
$re_email = $_POST['re_email'];
$re_user = $_POST['re_user'];
$re_pass = $_POST['re_pass'];
$re_pass1 = $_POST['re_pass1'];
$re_status = $_GET['re_status'];
$Submit = $_POST['Submit'];
$ok = $_POST['ok'];
/* end of add */
$re_status="1";
?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>:: ผลการสมัครสมาชิก ::</title>
</head>

<body>
<p>
  <?php
include("../../../../connect.php") ;
if($_POST){
	if(empty($re_name)){
	$errmsg.="<li>กรุณากรอกชื่อและนามสกุลด้วยครับ";
	}
		if(!ereg("([0-9]{13})",$re_id_no)){
	$errmsg.="<li>กรุณากรอกรหัสบัตรประชาชนให้ถูกต้องด้วยครับ";
	}
	if(empty($re_address)){
	$errmsg.="<li>กรุณากรอกที่อยู่ด้วยครับ";
	}
	if(!ereg("([0-9]{3})-([0-9]{7})",$re_phone)){
	$errmsg.="<li>กรุณาเบอร์โทรให้ถูกต้องด้วยครับ";
	}
	if(empty($re_user)){
	$errmsg.="<li>กรุณากรอกชื่อผู้เข้าใช้ระบบด้วยครับ";
	}
	if(empty($re_pass)){
	$errmsg.="<li>กรุณากรอกรหัสเข้าใช้ระบบด้วยครับ";
	}
	if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)$",$re_email)){
	$errmsg.= "<li>ขอโทษด้วย กรุณากรอกอีเมล์ให้ถูกต้องด้วย";
	//echo "<br><br><input type='button' value='back to edit' onclick='history.back();'></center></body></html>" ;
//exit() ;
}
	$sql = "select re_user from register where re_user='$re_user'" ;
	$result = mysql_query($sql) ;
	$numrow = mysql_num_rows($result) ;
	if($numrow!=0) {
	$errmsg.="<li>ขอโทษด้วย user $re_user นี้ ได้มีผู้ใช้ไปแล้ว กรุณาเปลี่ยนชื่อ Login ใหม่" ;
	//echo "<br><br><input type='button' value='back to edit' onclick='history.back();'></center></body></html>" ;
	//exit() ;
}

if($re_pass!=$re_pass1){
	$errmsg.= "<li>กรุณากรอกpassword ให้ตรงกันด้วนนะครับ" ;

	}
	
	
	
	
echo "<center>$errmsg</center>";
echo "<center><br><br><input type='button' value='back to edit' onclick='history.back();'></center></body></html>" ;
}


	if($errmsg==""){
$result = mysql_query("insert into register (re_id,re_name,re_id_no,re_address, re_phone,re_email,re_user,re_pass,re_status)
                                                  values('$re_id','$re_name','$re_id_no','$re_address','$re_phone','$re_email','$re_user','$re_pass','$re_status')");
   
if($result) {
//$_SESSION['login_true'] = $user_name;
echo '<script>alert("ขอบคุณมากสำหรับการลงทะเบียนเป็นสมาชิกของระบบ");</script>';
?>

<meta http-equiv="refresh" content="1;URL=../../user/show_user.php">
<?

}
	}
?>
</p>
</body>

</html>



ปัญหามีอยู่ว่าเมื่อเราลืมกรอกไปช่องนึงพอกด ปุ่ม back to edit ตรง check กลับไปหน้า from ข้อมูลหายหมดนะครับ
ผมอยากให้ข้อมูลยังอยู่คงที่ไม่ให้หายนะครับพอทำได้หรือป่าวมันน่าจะมีปัญหาครง sesstion_start();
พอมีวิํ๊ธีแนะนำปาวครับ



Tag : PHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-01-03 03:37:42 By : ploypetpot View : 839 Reply : 6
 

 

No. 1



โพสกระทู้ ( 139 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

มันยาวมาก :)






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-01-03 04:54:43 By : thaicloud
 


 

No. 2



โพสกระทู้ ( 5,146 )
บทความ ( 26 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์


ให้เชคข้อมูลก่อน submit ครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-01-03 05:09:32 By : deawx
 

 

No. 3



โพสกระทู้ ( 1,463 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Blogger

ถ้าก่อน session_start เคยทำได้ คำสั่งด้านล่างนี้จะช่วยแก้ไขปัญหาครับ
http://php.net/manual/en/function.session-cache-limiter.php
แต่เป็นแค่ header อะนะส่วน client (browser) จะเก็บข้อมูลให้หรือเปล่าก็แล้วแต่ครับ


สำหรับวิธีที่แนะนำถ้ายังไม่ใช้ ajax ก็คือ submit ไปยัง iframe

<form name="f1" action="save.php" target="frame_x" method="post">
<input type="text" name="t1"/>
<input type="submit" name="t1"/>
</form>
<iframe name="frame_x"></iframe>


ส่วนหน้า save.phpก็

<?php
if ($_POST['t1'] < 10){
echo "<script>alert('error');</script>";
} else {
echo "<script>alert('ok');</script>";
}
?>

ส่วนนี้แทนที่จะ alert เฉยๆ จะทำเป็น dynamic html ก้ได้ครับ


ประวัติการแก้ไข
2012-01-03 07:17:40
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-01-03 07:14:48 By : num
 


 

No. 4



โพสกระทู้ ( 68 )
บทความ ( 0 )



สถานะออฟไลน์


ขอบคุณครับสำหรับคำตอบ ผมกะที่จะใส่ javascript นะครับ
แต่ดันติดตรงนึงผมเขียนขึ้นมาไม่เป็นเพราะไม่ถนัดเรื่อง javascriptนะครับ
1. เรื่อง Email ให้มันเช็คว่า emailนี้รูปแบบถูกหรือป่าว
2.เรื่องเบอร์โทร xxx-xxxxxxx ผมไม่รู้จะเขียนยังไงนะครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-01-03 10:26:03 By : ploypetpot
 


 

No. 5



โพสกระทู้ ( 11,835 )
บทความ ( 10 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์


php header cache control หาดูครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-01-03 10:42:25 By : ikikkok
 


 

No. 6



โพสกระทู้ ( 68 )
บทความ ( 0 )



สถานะออฟไลน์


ตอบความคิดเห็นที่ : 5 เขียนโดย : ikikkok เมื่อวันที่ 2012-01-03 10:42:25
รายละเอียดของการตอบ ::
ได้เเล้วขอบคุณมากมายเลยครับ

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-01-03 18:26:24 By : ploypetpot
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ขอถามผู้รู้หน่อยครับมีโค๊ตมาให้ช่วยแก้หน่อยนะครับใครช่วยได้บอกทีงานชิ้นสุดท้าย
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 02
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่