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

HOME > PHP > PHP Forum > ขอโค้ดที่ให้ข้อมูลของเราแสดงออกมาเมื่อคลิกดูข้อมูลหน่อยค่ะ



 

ขอโค้ดที่ให้ข้อมูลของเราแสดงออกมาเมื่อคลิกดูข้อมูลหน่อยค่ะ

 



Topic : 075122



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



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




ขอโค้ดที่ให้ข้อมูลของเราแสดงออกมาเมื่อคลิกดูข้อมูลหน่อยค่ะ
เมื่อล็อกอินเข้ามาแล้วพอมาดูข้อมูลกลับไม่แสดงข้อมูลค่ะ



Tag : PHP, JavaScript







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-03-07 14:17:19 By : Liw View : 796 Reply : 3
 

 

No. 1



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

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

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

มีโค๊ดไหมครับ แปะไว้เด๋วมาให้คำแนะนำ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-07 14:34:40 By : Dragons_first
 


 

No. 2



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



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


//โค้ดล็อกอินค่ะ

Code (PHP)
<?php require_once('Connections/dbcon.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$colname_Recordset1 = "-1";
if (isset($_GET['data_id'])) {
  $colname_Recordset1 = $_GET['data_id'];
}
mysql_select_db($database_dbcon, $dbcon);
$query_Recordset1 = sprintf("SELECT * FROM m_datd WHERE data_id = %s", GetSQLValueString($colname_Recordset1, "int"));
$Recordset1 = mysql_query($query_Recordset1, $dbcon) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
  session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
  $_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['User'])) {
  $loginUsername=$_POST['User'];
  $password=$_POST['Pass'];
  $MM_fldUserAuthorization = "login_accesslevel";
  $MM_redirectLoginSuccess = "u_function.php";
  $MM_redirectLoginFailed = "123.php";
  $MM_redirecttoReferrer = true;
  mysql_select_db($database_dbcon, $dbcon);
  	
  $LoginRS__query=sprintf("SELECT login_user, login_pass, login_accesslevel FROM m_login WHERE login_user=%s AND login_pass=%s",
  GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); 
   
  $LoginRS = mysql_query($LoginRS__query, $dbcon) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
    
    $loginStrGroup  = mysql_result($LoginRS,0,'login_accesslevel');
    
    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;	      

    if (isset($_SESSION['PrevUrl']) && true) {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];	
    }
    header("Location: " . $MM_redirectLoginSuccess );
  }
  else {
    header("Location: ". $MM_redirectLoginFailed );
  }
}
?>
<!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=windows-874" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style16 {
	font-family: "Angsana New";
	font-weight: bold;
	font-size: 22px;
	color: #000000;
}
body {
	background-image: url(image/background/original_moonlight-wallpaper-01-1024x768.jpg);
	background-repeat: no-repeat;
}
-->
</style>
</head>

<body>
<table width="908" height="808" border="0" align="center" bgcolor="#FFFFFF">
  <tr>
    <td height="218" valign="top"><img src="image/header/header1_1.jpg" width="900" height="214" /></td>
  </tr>
  <tr>
    <td height="515" align="center" valign="middle">
     <form ACTION="<?php echo $loginFormAction; ?>" id="fmLogin" name="fmLogin" method="POST">
      <p>&nbsp;</p>
      <table width="478" height="304" border="0" align="center">
        <tr>
          <td valign="middle" background="image/login copy.jpg"><table width="371" border="0" align="center">
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td width="105">&nbsp;</td>
                <td width="144">&nbsp;</td>
                <td width="108">&nbsp;</td>
              </tr>
              <tr>
                <td align="right"><span class="style16">Username: </span></td>
                <td><input name="User" type="text" id="User" /></td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td align="right"><span class="style16">Password:</span></td>
                <td><input name="Pass" type="text" id="Pass" /></td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td><input type="submit" name="Submit" id="Submit" value="Login" />
                    <input type="reset" name="Reset" id="Reset" value="Cancel" /></td>
                                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
          </table></td>
        </tr>
      </table>
    </form>
      <p>&nbsp;</p>
    </td>
  </tr>
  <tr>
    <td><img src="image/header/Style7 copy.jpg" width="900" height="65" /></td>
  </tr>
</table>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>

//โค้ดแสดงข้อมูล
<?php require_once('Connections/dbcon.php'); ?><?php
//initialize the session
if (!isset($_SESSION)) {
  session_start();
}

// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
  $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
  //to fully log out a visitor we need to clear the session varialbles
  $_SESSION['MM_Username'] = NULL;
  $_SESSION['MM_UserGroup'] = NULL;
  $_SESSION['PrevUrl'] = NULL;
  unset($_SESSION['MM_Username']);
  unset($_SESSION['MM_UserGroup']);
  unset($_SESSION['PrevUrl']);
	
  $logoutGoTo = "form_login.php";
  if ($logoutGoTo) {
    header("Location: $logoutGoTo");
    exit;
  }
}
?><?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$colname_rsEmp = "-1";
if (isset($_GET['login_id'])) {
  $colname_rsEmp = $_GET['login_id'];
}
mysql_select_db($database_dbcon, $dbcon);
$query_rsEmp = sprintf("SELECT * FROM m_login WHERE login_id = %s", GetSQLValueString($colname_rsEmp, "int"));
$rsEmp = mysql_query($query_rsEmp, $dbcon) or die(mysql_error());
$row_rsEmp = mysql_fetch_assoc($rsEmp);
$totalRows_rsEmp = mysql_num_rows($rsEmp);
?><!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=windows-874" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {
	font-family: "Angsana New";
	font-size: 22px;
	font-weight: bold;
	color: #000033;
}
.style3 {font-family: "Angsana New"}
a:link {
	color: #000033;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #000033;
}
a:hover {
	text-decoration: none;
	color: #FF0000;
}
a:active {
	text-decoration: none;
	color: #FF0000;
}
body {
	background-image: url(image/background/original_moonlight-wallpaper-01-1024x768.jpg);
	background-repeat: no-repeat;
}
.style10 {font-family: "Angsana New"; color: #FF0000; }
.style5 {font-family: "Angsana New"; color: #000000; }
.style12 {color: #000000}
-->
</style>
</head>

<body>
<table width="908" height="1003" border="0" align="center" bgcolor="#FFFFFF">
  <tr>
    <td height="218" colspan="2" valign="top"><img src="image/header/header1_1.jpg" width="900" height="214" /></td>
  </tr>
  <tr>
    <td width="280" height="710" align="left" valign="top"><table width="280" height="152" border="0">
      <tr>
        <td width="279" align="center" valign="top" background="image/menuadmin/menu18 copy.jpg"><table width="245" border="0" align="center">
            <tr>
              <td width="55">&nbsp;</td>
              <td width="191">&nbsp;</td>
            </tr>
            <tr>
              <td colspan="2" align="center">&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td colspan="2"><table width="249" border="0">
                  <tr>
                    <td colspan="2" align="center"><span class="style1">เจ้าหน้าที่</span></td>
                  </tr>
                  <tr>
                    <td width="119" align="center">&nbsp;</td>
                    <td width="120" align="center">&nbsp;</td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td colspan="2" align="left" valign="top" class="style1">&nbsp;</td>
            </tr>
            <tr>
              <td colspan="2" align="left" valign="top" class="style1"><table width="200" border="0">
                  <tr>
                    <td width="21"><span class="style3"><img src="image/PNG/48/Home_01.png" width="20" height="20" /></span></td>
                    <td width="163" align="left" class="style1"><a href="u_function.php">หน้าแรก</a></td>
                  </tr>
              </table></td>
            </tr>
        </table></td>
      </tr>
    </table></td>
    <td width="618" align="center" valign="top"><table width="600" height="37" border="0">
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td colspan="2" align="center">&nbsp;</td>
      </tr>
      <tr>
        <td colspan="2" align="center">&nbsp;</td>
      </tr>
      <tr>
        <td colspan="2" align="center"><table width="384" border="0">
            <tr>
              <td width="107"><img src="image/PNG/48/Usercard_01.png" width="70" height="70" /></td>
              <td width="300" align="left"><img src="image/menuadmin/menu25 copy.jpg" width="300" height="70" /></td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
      <form id="fmDelete" name="fmDelete" method="post" action="">
        <table width="600" border="0">
          <tr>
            <td width="200">&nbsp;</td>
            <td width="390">&nbsp;</td>
          </tr>
          <tr>
            <td align="right" class="style1"><label for="checkbox_row_2"><span class="style12">user</span></label>
              <span class="style12">              name :<span class="style3">
                <label for="checkbox_row_2"></label>
              </span></span></td>
            <td align="left"><input name="login_user" type="text" id="login_user" value="<?php echo $row_rsEmp['login_user']; ?>" /></td>
          </tr>
          <tr>
            <td align="right" class="style1"><span class="style5">password :</span></td>
            <td align="left"><input name="login_pass" type="text" id="login_pass" value="<?php echo $row_rsEmp['login_pass']; ?>" /></td>
          </tr>
          <tr>
            <td align="right" class="style1"><span class="style5">ชื่อ :</span></td>
            <td align="left"><input name="login_name" type="text" id="login_name" value="<?php echo $row_rsEmp['login_name']; ?>" /></td>
          </tr>
          <tr>
            <td align="right" class="style1"><span class="style5">นามสกุล :</span></td>
            <td align="left"><input name="login_lasname" type="text" id="login_lasname" value="<?php echo $row_rsEmp['login_lasname']; ?>" /></td>
          </tr>
          <tr>
            <td align="right" class="style1"><span class="style5">e-mail :</span></td>
            <td align="left"><input name="login_email" type="text" id="login_email" value="<?php echo $row_rsEmp['login_email']; ?>" /></td>
          </tr>
          <tr>
            <td align="right" class="style1"><span class="style5">โทรศัพท์ :</span></td>
            <td align="left"><input name="login_phon" type="text" id="login_phon" value="<?php echo $row_rsEmp['login_phon']; ?>" /></td>
          </tr>
          <tr>
            <td align="right" class="style1"><span class="style5">สถานะเจ้าหน้าที่ :</span></td>
            <td align="left"><span class="style10">
              <input name="login_accesslevel" type="text" id="login_accesslevel" value="<?php echo $row_rsEmp['login_accesslevel']; ?>" />
            </span></td>
          </tr>

          <tr>
            <td>&nbsp;</td>
            <td align="left">&nbsp;</td>
          </tr>
        </table>
      </form>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
    </td>
  </tr>
  <tr>
    <td colspan="2"><img src="image/header/Style7 copy.jpg" width="900" height="65" /></td>
  </tr>
</table>
</body>
</html>
<?php
mysql_free_result($rsEmp);
?>


//ช่วยดูให้หน่อยค่ะทำมา 2 วันแล้ว
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-07 16:08:33 By : Liw
 

 

No. 3



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

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

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

คราวหน้าใส่แท็กภาษาด้วยนะครับ
ลอง echo $_SESSION['PrevUrl'] ออกมาดูหน่อยครับว่า มีการเก็บค่าไปแล้วหรือยัง

ถ้ายังให้ใส่ session_start(); ไว้บนสุดของบรรทัดนะครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-07 16:22:19 By : Dragons_first
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
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 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 อัตราราคา คลิกที่นี่