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 > ผมจะทำ http://xxxxxxxx.com/index.php?name=username ยังไงหรอครับ



 

ผมจะทำ http://xxxxxxxx.com/index.php?name=username ยังไงหรอครับ

 



Topic : 076922



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



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




ผมจะทำ http://site.com/index.php?name=xxxx ยังไงหรอครับพอดีผมทำระบบสมาชิกตาม https://www.thaicreate.com/community/php-mysql-login-form-check-username-password.html เสร็จแล้ว
ในฐานข้อมูลผมมี

UserID l Username l Password l Name l Email l Status

1.
คือว่าผมจะเอา Username มาทำเป็น http://site.com/index.php?name=xxxx <-- คือ username ดึง Username จากฐานข้อมูล อะครับ

2.และเมื่อมีคนเข้าลิ้ง http://site.com/index.php?name=xxxx ในหน้านั้นก็จะโชว์ ข้อมูลของ user นั้นๆ อะครับ

เช่น เมื่อผมเข้าไปที่ http://site.com/index.php?name=nook ก็จะโชว์

Name <-- ดึงจากฐานข้อมูล
Email <-- ดึงจากฐานข้อมูล


ขอให้เข้าใจ อธิบายไม่เก่ง



Tag : PHP, MySQL







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-04-11 01:13:55 By : nook00 View : 1481 Reply : 12
 

 

No. 1



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

Hall of Fame 2012

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


Code
<a href="http://site.com/index.php?name=<?=$objResult["username"] ?> ">// ส่วนของ link นะครับ

$id = $objResult[user_id]

srtSQL = select * from table_profile where user_id = '$id' ;

<table border="1" style="width: 300px">
<tbody>
<tr>
<td width="87"> &nbsp;ชื่อ</td>
<td width="197"><?=$objResult["Name"];?>
</td>
</tr>
<tr>
<td> &nbsp;E-mail</td>
<td><?=$objResult["email"];?></td>
</tr>
</tbody>
</table>


ว่าใน https://www.thaicreate.com/community/php-mysql-login-form-check-username-password.html
ก็อธิบายได้ดีแล้วนี่ครับ








ประวัติการแก้ไข
2012-04-11 08:23:36
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-04-11 08:22:03 By : time.toon
 


 

No. 2

Guest


อืมๆ สงสัยต้องรองหาหนังสือมาอ่านแล้ว ทุกทีใช้แต่สำเร็จรูป
http://www.tooktaall.com
------------------------------
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-04-11 09:14:09 By : tooktaall
 

 

No. 3



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

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

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


มันไม่ต่างอะไรกับการแก้ไขข้อมูลในบทเรียนหรอกครับ แค่ไม่ต้องยัดใส่ form element แค่นั้นเอง
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-04-11 10:41:21 By : ikikkok
 


 

No. 4



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



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


Parse error: syntax error, unexpected T_VARIABLE in C:\AppServ\www\test\test.php on line 4

Code (PHP)
<?php
include "config.php";
$id = $objResult['user_id']
$srtSQL = "SELECT * FROM TABLE_PROFILE WHERE User_ID = '$id' ";

?>

<a href="http://site.com/index.php?name=<?=$objResult["username"] ?> ">



<table border="1" style="width: 300px">
<tbody>
<tr>
<td width="87"> &nbsp;ชื่อ</td>
<td width="197"><?=$objResult["Name"];?>
</td>
</tr>
<tr>
<td> &nbsp;E-mail</td>
<td><?=$objResult["email"];?></td>
</tr>
</tbody>
</table>



ประวัติการแก้ไข
2012-04-11 11:10:38
2012-04-11 11:11:25
2012-04-11 11:12:11
2012-04-11 11:17:01
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-04-11 11:06:13 By : nook00
 


 

No. 5



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

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

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


อย่าบอกแค่ว่ามัน error ครับ เวลาถามช่วยบอกด้วยว่าไปทำอะไรมา แล้วมัน error ว่ายังไง คุณจะได้คำตอบเร็วขึ้นหลายเท่า
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-04-11 11:12:24 By : ikikkok
 


 

No. 6



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



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


ดันๆ อึบๆ ครับ ขอบคุณครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-04-11 11:25:24 By : nook00
 


 

No. 7



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

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

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


ไม่ได้ใส่ ;
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-04-11 11:52:20 By : ikikkok
 


 

No. 8



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



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


<?php
include "config.php";
$id = $objResult['user_id'];
$srtSQL = "SELECT * FROM TABLE_PROFILE WHERE User_ID = '$id' ";

?>

<a href="http://site.com/index.php?name=<?=$objResult["username"]?>">



<table border="1" style="width: 300px">
<tbody>
<tr>
<td width="87"> &nbsp;ชื่อ</td>
<td width="197"><?=$objResult["Name"];?>
</td>
</tr>
<tr>
<td> &nbsp;E-mail</td>
<td><?=$objResult["email"];?></td>
</tr>
</tbody>
</table>
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-04-11 13:06:17 By : gogo01
 


 

No. 9



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



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


มันยังดึงมาไม่ได้อะครับ ปัญหา error แก้ได้แล้วขอบคุณมากครับ น้ำใจเยอะดีบอร์ดนี้

ผมมี ฐานข้อมูลผมมี
UserID l Username l Password l Name l Email l Status

ผมจะดึงเอา Username มาเป็น http://site.com/test.php?name=xxxxx <---- xxx คือ username อะครับ พอดีเพิ่งหัดทำได้ไม่กี่วัน

Code (PHP)
<!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>Untitled Document</title>
</head>

<body>
</body>
</html>
<?

$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("test");
$strSQL = "SELECT * FROM member";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");

?>


<a href="test1.php?name=<?=$objResult["username"]?>">



<table border="1" style="width: 300px">
<tbody>
<tr>
<td width="87"> &nbsp;ชื่อ</td>
<td width="197"><?=$objResult["Name"];?>
</td>
</tr>
<tr>
<td> &nbsp;E-mail</td>
<td><?=$objResult["email"];?></td>
</tr>
</tbody>
</table>



ประวัติการแก้ไข
2012-04-12 03:45:20
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-04-11 17:29:41 By : nook00
 


 

No. 10



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



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


ดันๆ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-04-11 23:43:31 By : nook00
 


 

No. 11



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

Hall of Fame 2012

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


หน้าที่ต้องการแสดงชื่อ
Code (PHP)
<!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>Untitled Document</title>
</head>

<body>
<?

$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("test");
$strSQL = "SELECT * FROM member";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
<table width="600" border="1">
<tr>
<th width="91"> <div align="center">ชื่อของคุณ </div></th>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr>
<td><div align="center"><?=$objResult["username"];?></div></td>
<td><a href="test1.php?name=<?=$objResult["username"]?>">กดตรงนี้เพื่อไปหน้าUserของคุณ</a></td>
</tr>
</table>

</body>
</html>
หน้าที่ต้องการแสดงหลังจาก link

Code (PHP)
[php]<?
$username = $objResult[username];
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("test");
$strSQL = "SELECT * FROM member where '$username' ";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
<table width="600" border="1">
<tr>
<th width="91"> <div align="center">ชื่อของคุณ </div></th>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr>
<td><div align="center"><?=$objResult["username"];?></div></td>
<td><?=$objResult["sername"];?></td>
</tr>
</table>
<?
}
?>



ประวัติการแก้ไข
2012-04-12 08:02:01
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-04-12 07:01:58 By : time.toon
 


 

No. 12



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



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


มันยังดึงมาไม่ได้อะ


โค้ดส่ง
Code (PHP)
<!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>Untitled Document</title>
</head>

<body>
<?

$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("test");
$strSQL = "SELECT * FROM member";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
<table width="600" border="1">
<tr>
<th width="91"> <div align="center">ชื่อของคุณ </div></th>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{                                                                                                      //ตรงนี้ไม่มีตัวปิด
?>
<tr>
<td><div align="center"><?=$objResult["username"];?></div></td>

<td><a href="1.php?name=<?=$objResult["username"]?>">กดตรงนี้เพื่อไปหน้าUserของคุณ</a></td>
</tr>
</table>

</body>
</html>



หน้าที่ต้องการให้แสดงลิ้ง
Code (PHP)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<?
$username = $objResult["Username"];
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("test");
$strSQL = "SELECT * FROM member where '$Username' ";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");

?>
<table width="600" border="1">
<tr>
<th width="91"> <div align="center">ชื่อของคุณ </div></th>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr>
<td><div align="center"><?=$objResult["Username"];?></div></td>
<td><?=$objResult["Name"];?></td>
</tr>
</table>
<?
}
?>



ประวัติการแก้ไข
2012-04-12 12:13:38
2012-04-12 12:14:27
2012-04-12 12:15:16
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-04-12 12:12:56 By : nook00
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ผมจะทำ http://xxxxxxxx.com/index.php?name=username ยังไงหรอครับ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 00
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 อัตราราคา คลิกที่นี่