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,030

HOME > PHP > PHP Forum > อยากให้เวลาล็อกอินแล้วไปที่หน้า profile ของผู้ใช้ในทันที ช่วยแนะนำหน่อยครับ



 

อยากให้เวลาล็อกอินแล้วไปที่หน้า profile ของผู้ใช้ในทันที ช่วยแนะนำหน่อยครับ

 



Topic : 055843



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



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




ผมเพิ่งเริ่มหัดphp ครับ คือผมทำระบบสมาชิก ทีสมาชิกสามารถเข้าไปแก้ใขข้อมูลที่จะแสดงในเพจของตัวเองน่ะครับ
ที่อยากถามก็คือจะทำยังใงเวลาที่ผู้ใช้ล็อกอินแล้วมัน direct ไปที่หน้า profile ของผู้ใช้นั้นๆเลยน่ะครับ

นี่โคดล็อกอินที่ผมมี
Code (PHP)
<?php
session_start();
if($_POST)  {
	$email = $_POST['email'];
	$Password = $_POST['Password'];
	
	include("gubig.inc.php");
	my_connect();
	$sql = "SELECT * FROM supplier WHERE email = '$email' AND Password = '$Password';";
	$result = mysql_query($sql);
		if(mysql_num_rows($result) != 1) {
		echo "<font size=5 color=red>wrong username or password<p />
				 <a href=\"javascript: history.back()\">back to complete</a></font>";
	}
	else {
		$_SESSION['email'] = mysql_result($result, 0, "email");
		$_SESSION['Password'] =  mysql_result($result, 0, "Password");
		<?php
session_start();
if($_POST)  {
	$email = $_POST['email'];
	$Password = $_POST['Password'];
	
	include("gubig.inc.php");
	my_connect();
	$sql = "SELECT * FROM supplier WHERE email = '$email' AND Password = '$Password';";
	$result = mysql_query($sql);
		if(mysql_num_rows($result) != 1) {
		echo "<font size=5 color=red>wrong username or password<p />
				 <a href=\"javascript: history.back()\">back to complete</a></font>";
	}
	else {
		$_SESSION['email'] = mysql_result($result, 0, "email");
		$_SESSION['Password'] =  mysql_result($result, 0, "Password");
		header("Location:job/manathai/jshow_mtp.php");
	 	echo "welcome to gubig family";
	}
	
	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>supplier login page</title>
<style type="text/css">
<!--
body,td,th {
	font-family: Century Gothic, CordiaUPC, Calibri;
}
a:link {
	text-decoration: none;
}
a:visited {
	text-decoration: none;
}
a:hover {
	text-decoration: none;
}
a:active {
	text-decoration: none;
}
body {
	background-image: url(../Artwork/login.gif);
	background-repeat: no-repeat;
}
-->
</style></head>

<body>
<table width="339" height="58" border="0">
  <tr>
    <td height="54"><a href="../../home.php">big chat</a> | <a href="../../supplier.php">register as supplier</a></td>
  </tr>
</table>
<table width="991" height="142" border="0">
  <tr>
    <td height="138">&nbsp;</td>
  </tr>
  
</table>

<table width="993" height="298" border="0">
  <tr>
    <td height="294"><div align="center">
      <form id="form1" name="form1" method="post" action="">
        <p><strong>already register as a supplier, please log in</strong></p>
        <table width="442" border="0">
          <tr>
            <td width="168"><div align="left">company name</div></td>
            <td width="264"><label>
              <div align="left">
                <input name="name" type="text" id="name" size="50" />
                </div>
            </label></td>
          </tr>
          <tr>
            <td><div align="left">email address</div></td>
            <td><label>
              <div align="left">
                <input name="email" type="text" id="email" size="50" />
                </div>
            </label></td>
          </tr>
          <tr>
            <td><div align="left">password</div></td>
            <td><label>
              <div align="left">
                <input name="Password" type="password" id="Password" size="30" />
                </div>
            </label></td>
          </tr>
        </table>
        <p>
          <label>
          <input type="submit" name="login" id="login" value="login" />
          </label>
        </p>
      </form>
      </div></td>
  </tr>
</table>
<table width="991" height="147" border="0">
  <tr>
    <td height="143">&nbsp;</td>
  </tr>
</table>
<table width="992" border="0">
  <tr>
    <td><div align="center"><a href="../../index.php">home</a></div></td>
    <td><div align="center"><a href="../../about_us.php">idea</a></div></td>
    <td><div align="center"><a href="../../supplier login.php">supplier</a></div></td>
    <td><div align="center"><a href="../../career.php">careers</a></div></td>
    <td><div align="center"><a href="../../terms_of_use.php">privacy policy</a></div></td>
    <td><div align="center">support</div></td>
    <td><div align="center">site map</div></td>
    <td><div align="center"><a href="../../contact_us.php">contact us</a></div></td>
  </tr>
</table>
</body>
</html>

	 	echo "welcome to gubig family";
	}
	
	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>supplier login page</title>
<style type="text/css">
<!--
body,td,th {
	font-family: Century Gothic, CordiaUPC, Calibri;
}
a:link {
	text-decoration: none;
}
a:visited {
	text-decoration: none;
}
a:hover {
	text-decoration: none;
}
a:active {
	text-decoration: none;
}
body {
	background-image: url(../Artwork/login.gif);
	background-repeat: no-repeat;
}
-->
</style></head>

<body>
<table width="339" height="58" border="0">
  <tr>
    <td height="54"><a href="../../home.php">big chat</a> | <a href="../../supplier.php">register as supplier</a></td>
  </tr>
</table>
<table width="991" height="142" border="0">
  <tr>
    <td height="138">&nbsp;</td>
  </tr>
  
</table>

<table width="993" height="298" border="0">
  <tr>
    <td height="294"><div align="center">
      <form id="form1" name="form1" method="post" action="">
        <p><strong>already register as a supplier, please log in</strong></p>
        <table width="442" border="0">
          <tr>
            <td width="168"><div align="left">company name</div></td>
            <td width="264"><label>
              <div align="left">
                <input name="name" type="text" id="name" size="50" />
                </div>
            </label></td>
          </tr>
          <tr>
            <td><div align="left">email address</div></td>
            <td><label>
              <div align="left">
                <input name="email" type="text" id="email" size="50" />
                </div>
            </label></td>
          </tr>
          <tr>
            <td><div align="left">password</div></td>
            <td><label>
              <div align="left">
                <input name="Password" type="password" id="Password" size="30" />
                </div>
            </label></td>
          </tr>
        </table>
        <p>
          <label>
          <input type="submit" name="login" id="login" value="login" />
          </label>
        </p>
      </form>
      </div></td>
  </tr>
</table>
<table width="991" height="147" border="0">
  <tr>
    <td height="143">&nbsp;</td>
  </tr>
</table>
<table width="992" border="0">
  <tr>
    <td><div align="center"><a href="../../index.php">home</a></div></td>
    <td><div align="center"><a href="../../about_us.php">idea</a></div></td>
    <td><div align="center"><a href="../../supplier login.php">supplier</a></div></td>
    <td><div align="center"><a href="../../career.php">careers</a></div></td>
    <td><div align="center"><a href="../../terms_of_use.php">privacy policy</a></div></td>
    <td><div align="center">support</div></td>
    <td><div align="center">site map</div></td>
    <td><div align="center"><a href="../../contact_us.php">contact us</a></div></td>
  </tr>
</table>
</body>
</html>



ตอนนี้ที่เจอคือพอล็อกอินแล้วมันก้ตรงไปตามนี้ header("Location:job/manathai/jshow_mtp.php"); เราจะทำยังใงให้มันไปเพจที่ถูกต้องโดยใช้ข้อมูลจาก username กับ password ที่ใช้ล็อกอินครับ



Tag : PHP, MySQL, Action Script, Ajax, jQuery, WebService







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2011-02-10 17:18:32 By : thanadol View : 802 Reply : 2
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

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

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

Go to : PHP MySQL กับ Login Form ทำระบบ User ล็อกอิน แบบง่าย ๆ ด้วย PHP และ MySQL โดยทำการตรวจสอบ Username และ Password

ใช้คำสั่ง header(""); ไปยัง หน้า profiles ของสมาชิกเลยครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-02-10 23:27:17 By : webmaster
 


 

No. 2



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



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


ขอบคุณครับพี่วิน เดี๋ยวจะลองดูนะครับ ขอบคุณครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-02-11 06:22:24 By : thanadol
 

   

ค้นหาข้อมูล


   
 

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