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 > สอบถามเรื่อง การแก้ไขข้อมูลสมาชิก หลัง login หน่อยค่ะ



 

สอบถามเรื่อง การแก้ไขข้อมูลสมาชิก หลัง login หน่อยค่ะ

 



Topic : 074847



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



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



คือว่า..จะทำหน้า แก้ไขข้อมุลสมาชิกอ่ะค่ะ หลังจาก login เข้ามาแล้วค่ะ (เขียนจาก Dreamweaver เป็น php ค่ะ)

แต่ ณ ตอนนี้มันดึงข้อมูลของสมาชิกคนแรกในตารางขึ้นมาให้แก้ไขแทนอ่ะค่ะ มันไม่ใช่ข้อมูลของ user ที่ login เข้ามา

ไม่ทราบว่าจะต้องทำยังงัย ที่ไฟล์ไหนบ้างคะ (มีคนบอกว่าให้ใช้ session แต่ประเดินสำคัญคือ..ใช้ไม่เป็นค่ะ - -*)

ขอบคุณล่วงหน้านะคะ



Tag : PHP, MySQL







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-03-01 15:02:03 By : momiya123 View : 1559 Reply : 4
 

 

No. 1



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



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


เวลาที่ user login เข้ามาแล้วก็เอาแบบ บ้าน ๆเลยนะครับ

<input type="hidden" name="user" id="user" value="<?
require_once('Connections/connect.php');
$sql="select * from member where user='$_SESSION[MM_Username]' ";
$result=mysql_query($sql);
while($row=mysql_fetch_object($result) )
{
echo $row->user ;
}
?>"/>

ก็สร้าง textbox ไว้ใน form แล้วก็ hidden เอาไว้ครับ ตามโค้ดด้านบน แล้วก็ใช้วิธีค้นหาเอาครับ พอมีทางไหมครับ
อย่าลืม

<?
session_start(); //session_start()
?>
ไว้บรรทัดบนสุดนะครับ








ประวัติการแก้ไข
2012-03-01 16:08:31
2012-03-01 16:08:37
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-01 15:59:00 By : addy_it
 


 

No. 2



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



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


Go to : PHP MySQL กับ Login Form ทำระบบ User ล็อกอิน แบบง่าย ๆ ด้วย PHP และ MySQL โดยทำการตรวจสอบ Username และ Password
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-01 16:11:35 By : rakmomteesud
 

 

No. 3



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



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

ดูโค๊ดหน้า login แล้วงงๆ ค่ะ เพราะไม่ได้เขียนเอง เป็นหน้าอีเมล์ของ squirrelmail ค่ะ ส่งที่จะต้องทำคือ หน้าแก้ไขข้อมูลสมาชิกอย่างที่ว่าล่ะคะ

ส่วนนี่เป็นโค้ดหน้า login ค่ะ

<?php

/**
* login.php -- simple login screen
*
* This a simple login screen. Some housekeeping is done to clean
* cookies and find language.
*
* @copyright 1999-2011 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: login.php 14084 2011-01-06 02:44:03Z pdontthink $
* @package squirrelmail
*/

/** This is the login page */
define('PAGE_NAME', 'login');

/**
* Path for SquirrelMail required files.
* @ignore
*/
define('SM_PATH','../');

/* SquirrelMail required files. */
require_once(SM_PATH . 'functions/global.php');
require_once(SM_PATH . 'functions/i18n.php');
require_once(SM_PATH . 'functions/plugin.php');
require_once(SM_PATH . 'functions/constants.php');
require_once(SM_PATH . 'functions/page_header.php');
require_once(SM_PATH . 'functions/html.php');
require_once(SM_PATH . 'functions/forms.php');

/**
* $squirrelmail_language is set by a cookie when the user selects
* language and logs out
*/
set_up_language($squirrelmail_language, TRUE, TRUE);

/**
* In case the last session was not terminated properly, make sure
* we get a new one, but make sure we preserve session_expired_*
*/
$sep = '';
$sel = '';
sqGetGlobalVar('session_expired_post', $sep, SQ_SESSION);
sqGetGlobalVar('session_expired_location', $sel, SQ_SESSION);

/* blow away session */
sqsession_destroy();

/**
* in some rare instances, the session seems to stick
* around even after destroying it (!!), so if it does,
* we'll manually flatten the $_SESSION data
*/
if (!empty($_SESSION)) {
$_SESSION = array();
}

/**
* Allow administrators to define custom session handlers
* for SquirrelMail without needing to change anything in
* php.ini (application-level).
*
* In config_local.php, admin needs to put:
*
* $custom_session_handlers = array(
* 'my_open_handler',
* 'my_close_handler',
* 'my_read_handler',
* 'my_write_handler',
* 'my_destroy_handler',
* 'my_gc_handler',
* );
* session_module_name('user');
* session_set_save_handler(
* $custom_session_handlers[0],
* $custom_session_handlers[1],
* $custom_session_handlers[2],
* $custom_session_handlers[3],
* $custom_session_handlers[4],
* $custom_session_handlers[5]
* );
*
* We need to replicate that code once here because PHP has
* long had a bug that resets the session handler mechanism
* when the session data is also destroyed. Because of this
* bug, even administrators who define custom session handlers
* via a PHP pre-load defined in php.ini (auto_prepend_file)
* will still need to define the $custom_session_handlers array
* in config_local.php.
*/
global $custom_session_handlers;
if (!empty($custom_session_handlers)) {
$open = $custom_session_handlers[0];
$close = $custom_session_handlers[1];
$read = $custom_session_handlers[2];
$write = $custom_session_handlers[3];
$destroy = $custom_session_handlers[4];
$gc = $custom_session_handlers[5];
session_module_name('user');
session_set_save_handler($open, $close, $read, $write, $destroy, $gc);
}

/* put session_expired_* variables back in session */
sqsession_is_active();
if (!empty($sel)) {
sqsession_register($sel, 'session_expired_location');
if (!empty($sep))
sqsession_register($sep, 'session_expired_post');
}

// Disable Browser Caching
//
header('Cache-Control: no-cache, no-store, must-revalidate');
header('Pragma: no-cache');
header('Expires: Sat, 1 Jan 2000 00:00:00 GMT');

do_hook('login_cookie');

$loginname_value = (sqGetGlobalVar('loginname', $loginname) ? htmlspecialchars($loginname) : '');

/* Output the javascript onload function. */

$header = "<script language=\"JavaScript\" type=\"text/javascript\">\n" .
"<!--\n".
" var alreadyFocused = false;\n".
" function squirrelmail_loginpage_onload() {\n".
" document.login_form.js_autodetect_results.value = '" . SMPREF_JS_ON . "';\n".
" if (alreadyFocused) return;\n".
" var textElements = 0;\n".
" for (i = 0; i < document.login_form.elements.length; i++) {\n".
" if (document.login_form.elements[i].type == \"text\" || document.login_form.elements[i].type == \"password\") {\n".
" textElements++;\n".
" if (textElements == " . (isset($loginname) ? 2 : 1) . ") {\n".
" document.login_form.elements[i].focus();\n".
" break;\n".
" }\n".
" }\n".
" }\n".
" }\n".
"// -->\n".
"</script>\n";
$custom_css = 'none';

// Load default theme if possible
if (@file_exists($theme[$theme_default]['PATH']))
@include ($theme[$theme_default]['PATH']);

if (! isset($color) || ! is_array($color)) {
// Add default color theme, if theme loading fails
$color = array();
$color[0] = '#dcdcdc'; /* light gray TitleBar */
$color[1] = '#800000'; /* red */
$color[2] = '#cc0000'; /* light red Warning/Error Messages */
$color[4] = '#ffffff'; /* white Normal Background */
$color[7] = '#0000cc'; /* blue Links */
$color[8] = '#000000'; /* black Normal text */
}

displayHtmlHeader( "$org_name - " . _("Login"), $header, FALSE );

echo "<body text=\"$color[8]\" bgcolor=\"$color[4]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\" onLoad=\"squirrelmail_loginpage_onload();\">" .
"\n" . addForm('redirect.php', 'post', 'login_form');

$username_form_name = 'login_username';
$password_form_name = 'secretkey';
do_hook('login_top');


if(sqgetGlobalVar('mailtodata', $mailtodata)) {
$mailtofield = addHidden('mailtodata', $mailtodata);
} else {
$mailtofield = '';
}

/* If they don't have a logo, don't bother.. */
if (isset($org_logo) && $org_logo) {
/* Display width and height like good little people */
$width_and_height = '';
if (isset($org_logo_width) && is_numeric($org_logo_width) &&
$org_logo_width>0) {
$width_and_height = " width=\"$org_logo_width\"";
}
if (isset($org_logo_height) && is_numeric($org_logo_height) &&
$org_logo_height>0) {
$width_and_height .= " height=\"$org_logo_height\"";
}
}

echo html_tag( 'table',
html_tag( 'tr',
html_tag( 'td',
'<center>'.
( isset($org_logo) && $org_logo
? '<img src="' . $org_logo . '" alt="' .
sprintf(_("%s Logo"), $org_name) .'"' . $width_and_height .
' /><br />' . "\n"
: '' ).
( (isset($hide_sm_attributions) && $hide_sm_attributions) ? '' :
'<small>' . sprintf (_("SquirrelMail version %s"), $version) . '<br />' ."\n".
' ' . _("By the SquirrelMail Project Team") . '<br /></small>' . "\n" ) .
html_tag( 'table',
html_tag( 'tr',
html_tag( 'td',
'<b>' . sprintf (_("%s Login"), $org_name) . "</b>\n",
'center', $color[0] )
) .
html_tag( 'tr',
html_tag( 'td', "\n" .
html_tag( 'table',
html_tag( 'tr',
html_tag( 'td',
_("Name:") ,
'right', '', 'width="30%"' ) .
html_tag( 'td',
addInput($username_form_name, $loginname_value, 0, 0, ' onfocus="alreadyFocused=true;"'),
'left', '', 'width="70%"' )
) . "\n" .
html_tag( 'tr',
html_tag( 'td',
_("Password:") ,
'right', '', 'width="30%"' ) .
html_tag( 'td',
addPwField($password_form_name, null, ' onfocus="alreadyFocused=true;"').
addHidden('js_autodetect_results', SMPREF_JS_OFF).
$mailtofield .
addHidden('just_logged_in', '1'),
'left', '', 'width="70%"' )
) ,
'center', $color[4], 'border="0" width="100%"' ) ,
'left',$color[4] )
) .
html_tag( 'tr',
html_tag( 'td',
'<center>'. addSubmit(_("Login")) .'</center>',
'left' )
),
'', $color[4], 'border="0" width="350"' ) . '</center>',
'center' )
) ,
'', $color[4], 'border="0" cellspacing="0" cellpadding="0" width="100%"' );
do_hook('login_form');
echo '</form>' . "\n";

do_hook('login_bottom');
?>
</body></html>
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-01 16:32:24 By : momiya123
 


 

No. 4



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



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

ส่วนอันนี้ เป็น code หน้า login ไฟล์เดียวกันค่ะ แต่เป็นไฟล์ที่ เปิดจาก chrome แล้วตรวจสอบองประกอบค่ะ ลองเอาไปใช้แทนกันดูแล้วใช้ได้ค่ะ

ตามนี้ค่ะ



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>
<meta name="robots" content="noindex,nofollow">
<meta http-equiv="x-dns-prefetch-control" content="off">
<script type="text/javascript" language="JavaScript">
<!--
if (self != top) { try { if (document.domain != top.document.domain) { throw "Clickjacking security violation! Please log out immediately!"; /* this code should never execute - exception should already have been thrown since it's a security violation in this case to even try to access top.document.domain (but it's left here just to be extra safe) */ } } catch (e) { self.location = "/webmail/src/signout.php"; top.location = "/webmail/src/signout.php" } }
// -->
</script>

<title>SquirrelMail - Login</title><script language="JavaScript" type="text/javascript">
<!--
var alreadyFocused = false;
function squirrelmail_loginpage_onload() {
document.login_form.js_autodetect_results.value = '1';
if (alreadyFocused) return;
var textElements = 0;
for (i = 0; i < document.login_form.elements.length; i++) {
if (document.login_form.elements[i].type == "text" || document.login_form.elements[i].type == "password") {
textElements++;
if (textElements == 1) {
document.login_form.elements[i].focus();
break;
}
}
}
}
// -->
</script>

<!--[if IE 6]>
<style type="text/css">
/* avoid stupid IE6 bug with frames and scrollbars */
body {
width: expression(document.documentElement.clientWidth - 30);
}
</style>
<![endif]-->

</head>

<body text="#000000" bgcolor="#ffffff" link="#0000cc" vlink="#0000cc" alink="#0000cc" onLoad="squirrelmail_loginpage_onload();">
<form action="redirect.php" method="post" name="login_form" >
<table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><center><img src="../images/sm_logo.png" alt="SquirrelMail Logo" width="308" height="111" /><br />
<small>SquirrelMail version 1.4.22<br />
By the SquirrelMail Project Team<br /></small>
<table bgcolor="#ffffff" border="0" width="350"><tr><td bgcolor="#dcdcdc" align="center"><b>SquirrelMail Login</b>
</td>
</tr>
<tr><td bgcolor="#ffffff" align="left">
<table bgcolor="#ffffff" align="center" border="0" width="100%"><tr><td align="right" width="30%">Name:</td>
<td align="left" width="70%"><input type="text" name="login_username" value="" onFocus="alreadyFocused=true;" />
</td>
</tr>

<tr><td align="right" width="30%">Password:</td>
<td align="left" width="70%"><input type="password" name="secretkey" onFocus="alreadyFocused=true;" />
<input type="hidden" name="js_autodetect_results" value="0" />
<input type="hidden" name="just_logged_in" value="1" />
</td>
</tr>
</table>
</td>
</tr>
<tr><td align="left"><center><input type="submit" value="Login" />
</center></td>
</tr>
</table>
</center></td>
</tr>
</table>
</form>
</body></html>
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-01 16:35:08 By : momiya123
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : สอบถามเรื่อง การแก้ไขข้อมูลสมาชิก หลัง 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 04
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 อัตราราคา คลิกที่นี่