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 > ถามเรื่อง login ครับ คือตอนนี้ มีกำลังศึกษาเรื่องระบบ login อยู่ครับ แต่ตอนนี้หามาได้แค่นี้เอง มีเรื่องอยากให้พี่ๆช่วยเขียนโค้ดตัว



 

ถามเรื่อง login ครับ คือตอนนี้ มีกำลังศึกษาเรื่องระบบ login อยู่ครับ แต่ตอนนี้หามาได้แค่นี้เอง มีเรื่องอยากให้พี่ๆช่วยเขียนโค้ดตัว

 



Topic : 018846

Guest




คือตอนนี้ มีกำลังศึกษาเรื่องระบบ login อยู่ครับ แต่ตอนนี้หามาได้แค่นี้เอง
มีเรื่องอยากให้พี่ๆช่วยเขียนโค้ดตัว
changepw.php
logout.php
edit.php
forgetpassword.html
connect.php
หน่อยครับ
เพราะหาไม่ได้แล้วจริงๆ และโค้ดที่ได้มาไม่รู้ว่าผิดรึเปล่าด้วย ถ้าไงช่วยดูหน่อยนะครับ

นี้คือโค้ดที่ผมมีอยู่นะครับ

----- index.html -------
<html>
<head><title>Member ระบบสมาชิก</title><meta http-equiv="Content-Type" content="text/html; charset=windows-874"></head>
<body>
<h1>:: Login ::</h1>
<form method="POST" action="chkmember.php">
<table>
<tr>
<td><b>Username :</b></td>
<td><input name="user_login" type="text">*</td>
</tr>
<tr>
<td><b>Password :</b></td>
<td><input name="pass_login" type="password">*</td>
</tr>
</table>
<input type="Submit" value="Submit">
<input type="Reset" value="Reset">
<p><a href= "register.html">สมัครสมาชิก</a> l
<a href= "forgetpassword.html">ลืมรหัสผ่าน</a></p>
</form>
</body>
</html>

----- chkmember.php -------
<?
session_start ();

$user_login=$_POST['user_login'];
$pass_login=$_POST['pass_login'];

if ($user_login=="" or $pass_login=="") {
echo "<h3>กรอกข้อมูลให้ครบ&ordm;<h3>";
exit();
}
else{
include "connect.php";
$sql="select * from tb_member where username='$user_login' and password='$pass_login'";
$result=mysql_db_query ($dbname,$sql);
$num=mysql_num_rows ($result);
mysql_close ();

if ($num<=0){
echo "<h4>ERROR : Login failed! : Username and/or Password not corrected </h4>";
} else {
$_SESSION ['sess_userid'] =session_id ();
$_SESSION ['sess_username'] =$user_login;
header ("Location: main.php");
}
}
?>

----- chksession.php -------
<?
session_start ();
$sess_userid = $_SESSION ['sess_userid'];
$sess_username = $_SESSION ['sess_username'];
if ($sess_userid != session_id () or $sess_username=="") {
header ("Location: index.html");
exit ();
}
?>

----- main.php -------
<?
include "chksession.php";
?>
<html>
<head><title>Member ระบบสมาชิก</title><meta http-equiv="Content-Type" content="text/html; charset=windows-874"></head>
<body>
<h1>:: Logined In System ::</h1>
<p>ยินดีต้อนรับคุณ<b><?=$sess_username?></b>ท่านกำลังอยู่ในระบบสมาชิก</p>
<p> [<a href="edit.php">แก้ข้อมูลส่วนตัว</a>]
[<a href="changepw.php">เปลี่ยนรหัสผ่าน</a>]
[<a href="logout.php">ออกจากระบบ</a>] </p>
</body>
</html>

----- register.html -------
<html>
<head><title>Member ระบบสมาชิก</title><meta http-equiv="Content-Type" content="text/html; charset=windows-874"></head>
<body>
<h1>:: Register ::</h1>
<form method="POST" action="chkmember.php">
<table>
<tr>
<td width="93"><b>Username :</b></td>
<td width="163"><input name="user_login" type="text">*</td>
</tr>
<tr>
<td><b>Password :</b></td>
<td><input name="pass_login" type="password">*</td>
</tr>
<tr>
<td><b>ชื่อ-นามสกุล :</b></td>
<td><input name="name" type="password" id="name">*</td>
</tr>
<tr>
<td><b>ที่อยู่ :</b></td>
<td><input name="location" type="password" id="location">*</td>
</tr>
</table>
<input type="Submit" value="Submit">
<input type="Reset" value="Reset">
</form>
</body>
</html>

ขอบคุณครับ


Tag : - - - -







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 10 มี.ค. 2551 11:11:58 By : ต้น View : 1501 Reply : 5
 

 

No. 1



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



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


ลอง copy ตัวนี้ไปใช้ดูนะครับ

admin.php ใช้โค้ด

<html>
<head>
<title></title><meta http-equiv="Content-Type" content="text/html; charset=windows-874"></head>
<body text="#FF0000">
<p align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<form method="post" action="admin_check.php">
<table width="369" border="0" align="center" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr bgcolor="#CCCCFF">
<td width="369" height="200" valign="top" bgcolor="#FFFFFF"><p align="center">&nbsp;</p>
<p align="center"><font color ="#FF0000" size="3" face="MS Sans Serif">Username :</font>
<font color="#FF0000" size="3" face="MS Sans Serif">
<input name="user" type="text" >
*</font></p>
<p align="center"><font color ="#FF0000" size="3" face="MS Sans Serif">Password :</font>
<font color="#FF0000" size="3" face="MS Sans Serif">
<input name="pass" type="password" >
*</font></p>
<p align="center"><font color="#FF0000" size="3" face="MS Sans Serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" name="Submit" value="เข้าสู่ระบบ">
<input name="Reset" type="reset" id="Reset" value="ยกเลิก">
</font>
<p align="center"></td>
</tr>
</table>
</form>
</body>
</html>



ฟอร์มเช็คข้อมูล คือ ?
admin_check.php

<?
$user=$_POST['user'];
$pass=$_POST['pass'];

if ($user=="prawjame" and $pass=="07233550917") {
session_start();
session_register("sess_adminid");
$sess_adminid=session_id();
header("Location: admin_home.php");
} else {
echo "<center><H2>Username หรือ Password ไม่ถูกต้อง</H2></center>";
}
?>







Date : 10 มี.ค. 2551 11:30:21 By : SpyBNC
 


 

No. 2

Guest


ขอบคุณครับ

แล้วพี่มีฟอมสมัครด้วยปะครับ
ผมขอด้วยอีก 1 โค้ดได้ไหมครับ
Date : 10 มี.ค. 2551 13:49:27 By : ต้น
 

 

No. 3



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



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


ง่า เอางั้นเลยเหรอครับ...อิอิ
Date : 10 มี.ค. 2551 17:14:17 By : SpyBNC
 


 

No. 4

Guest


หาได้ตามที่มี ระบบนั้นๆครับ

เข้าไปที่ View เลือกหัวข้อ Source ครับ ^^
Date : 2009-08-05 20:09:48 By : PoU
 


 

No. 5

Guest


Code (PHP)
<?
	mysql_connect("localhost","root","root");
	mysql_select_db("mydatabase");
	$strSQL = "SELECT * FROM member WHERE Username = '".trim($_POST['txtUsername'])."' 
	OR Email = '".trim($_POST['txtEmail'])."' ";
	$objQuery = mysql_query($strSQL);
	$objResult = mysql_fetch_array($objQuery);
	if(!$objResult)
	{
			echo "Not Found Username or Email!";
	}
	else
	{
			echo "Your password send successful.<br>Send to mail : ".$objResult["Email"];		

			$strTo = $objResult["txtEmail"];
			$strSubject = "Your Account information username and password.";
			$strHeader = "Content-type: text/html; charset=windows-874\n"; // or UTF-8 //
			$strHeader .= "From: [email protected]\nReply-To: [email protected]";
			$strMessage = "";
			$strMessage .= "Welcome : ".$objResult["Name"]."<br>";
			$strMessage .= "Username : ".$objResult["Username"]."<br>";
			$strMessage .= "Password : ".$objResult["Password"]."<br>";
			$strMessage .= "=================================<br>";
			$strMessage .= "ThaiCreate.Com<br>";
			$flgSend = mail($strTo,$strSubject,$strMessage,$strHeader); 

	}
	mysql_close();
?>


Go to : PHP Forgot Lost Password and Sending Password to Mail ทำ Form ลืมรหัสผ่าน ด้วย PHP กับ MySQL
Date : 2011-07-07 11:12:03 By : thaicreate
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ถามเรื่อง login ครับ คือตอนนี้ มีกำลังศึกษาเรื่องระบบ login อยู่ครับ แต่ตอนนี้หามาได้แค่นี้เอง มีเรื่องอยากให้พี่ๆช่วยเขียนโค้ดตัว
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 05
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 อัตราราคา คลิกที่นี่