HOME > PHP > PHP Forum > ทำลิ้ง id ให้กับ user ทำยังไงครับผมกำลังทำโปรเจคเว็บไซต์ มีปัญหาหาตอน user 1 กด ไปชม profile user 2 แต่ดันกลับมาเป็น profile ตัวเอง
ทำลิ้ง id ให้กับ user ทำยังไงครับผมกำลังทำโปรเจคเว็บไซต์ มีปัญหาหาตอน user 1 กด ไปชม profile user 2 แต่ดันกลับมาเป็น profile ตัวเอง
$result = mysql_query("select * from member where user='$_SESSION[login_true]'") or die ("Err Can not to result") ;
$dbarr = mysql_fetch_array($result) ;
?>
<head>
<meta http-equiv='refresh' content='1500; url=post.php'>
<meta http-equiv="content-type" charset="windows-874">
<link rel="stylesheet" type="text/css" href="../css/table_style.css">
<link rel="stylesheet" type="text/css" href="../css/style.css">
<link rel="stylesheet" type="text/css" href="../css/player.css">
</head>
<?php
include("config.inc.php") ;
mysql_select_db($db) ;
$strSQL = "SELECT * FROM webboard order by QuestionID desc ";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$Num_Rows = mysql_num_rows($objQuery);
<?php
#### สคริ๊ปนี้ใช้ในการเช็ค ว่าล็อกอินหรือยัง ให้นำสคริ๊ปนี้ไปไว้ที่หน้าที่คุณต้องการให้เช็ค ####
session_start() ;
if (!isset($_SESSION['login_true'])) {
header("Location: index.php");
exit;
}
### จบการเช็ค ###
?>
<!doctype html>
<html>
<head>
<meta http-equiv="content-type" charset="windows-874">
<link rel="stylesheet" type="text/css" href="../css/table_style.css">
<link rel="stylesheet" type="text/css" href="../css/style.css">
<link rel="stylesheet" type="text/css" href="../css/player.css">
<style type="text/css">
.top-commenter-line {margin: 3px 0;}
.top-commenter-line .profile-name-link {padding-left:0;}
.top-commenter-avatar {vertical-align:middle;}
</style>
<script type="text/javascript">
//
// Top Commentators gadget with avatars, by MS-potilas 2012.
// Gets a list of top commentators from all comments, or specified number of days in the past.
// See http://yabtb.blogspot.com/2012/05/top-commenters-gadget-with-avatars.html
//
// CONFIG:
var maxTopCommenters = 5; // how big a list of top commentators
var minComments = 1; // how many comments must top commentator have at least
var numDays = 0; // from how many days (ex. 30), or 0 from "all the time"
var excludeMe = true; // true: exclude my own comments
var excludeUsers = ["Anonymous", "someotherusertoexclude"]; // exclude these usernames
var maxUserNameLength = 42; // 0: don't cut, >4: cut usernames
//
var txtTopLine = '<b>[#].</b> [image] [user] ([count])';
var txtNoTopCommenters = 'No top commentators at this time.';
var txtAnonymous = ''; // empty, or Anonymous user name localized if you want to localize
//
var sizeAvatar = 16;
var cropAvatar = true;
//
var urlNoAvatar = "http://lh4.googleusercontent.com/-069mnq7DV_g/TvgRrBI_JaI/AAAAAAAAAic/Iot55vywnYw/s"+sizeAvatar+"/avatar_blue_m_96.png"; // http://www.blogger.com/img/avatar_blue_m_96.png resizeable
var urlAnoAvatar = 'http://www.gravatar.com/avatar/00000000000000000000000000000000?d=mm&s=' + sizeAvatar;
var urlMyProfile = ''; // set if you have no profile gadget on page
var urlMyAvatar = ''; // can be empty (then it is fetched) or url to image
// config end
// for old IEs & IE modes:
if(!Array.indexOf) {
Array.prototype.indexOf=function(obj) {
for(var i=0;i<this.length;i++) if(this[i]==obj) return i;
return -1;
}}
function replaceTopCmtVars(text, item, position)
{
if(!item || !item.author) return text;
var author = item.author;
text = text.replace('[user]', authorcode);
text = text.replace('[image]', imgcode);
text = text.replace('[#]', position);
text = text.replace('[count]', item.count);
return text;
}
var topcommenters = {};
var ndxbase = 1;
function showTopCommenters(json) {
var one_day=1000*60*60*24;
var today = new Date();
if(urlMyProfile == "") {
var elements = document.getElementsByTagName("*");
var expr = /(^| )profile-link( |$)/;
for(var i=0 ; i<elements.length ; i++)
if(expr.test(elements[i].className)) {
urlMyProfile = elements[i].href;
break;
}
}
if(json && json.feed && json.feed.entry && json.feed.entry.length) for(var i = 0 ; i < json.feed.entry.length ; i++ ) {
var entry = json.feed.entry[i];
if(numDays > 0) {
var datePart = entry.published.$t.match(/\d+/g); // assume ISO 8601
var cmtDate = new Date(datePart[0],datePart[1]-1,datePart[2],datePart[3],datePart[4],datePart[5]);
//Calculate difference btw the two dates, and convert to days
var days = Math.ceil((today.getTime()-cmtDate.getTime())/(one_day));
if(days > numDays) break;
}
var authorUri = "";
if(entry.author[0].uri && entry.author[0].uri.$t != "")
authorUri = entry.author[0].uri.$t;
$result = mysql_query("select * from member where user='$_SESSION[login_true]'") or die ("Err Can not to result") ;
$dbarr = mysql_fetch_array($result) ;
<?php
include("config.inc.php") ;
mysql_select_db($db) ;
$result = mysql_query("select * from member where user='$user'") or die ("Err Can not to result") ;
$dbarr = mysql_fetch_array($result) ;
?>