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 > สอบถามเรื่องระบบป้องกันการเข้าข้อมูลโดยตรง สอบถามเรื่องระบบป้องกันการเข้าข้อมูลโดยตรง



 

สอบถามเรื่องระบบป้องกันการเข้าข้อมูลโดยตรง สอบถามเรื่องระบบป้องกันการเข้าข้อมูลโดยตรง

 



Topic : 045489



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



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



สอบถามเรื่องระบบป้องกันการเข้าข้อมูลโดยตรง ผมไม่รู้ว่าใช้ code อะไรในการป้องกันการเข้าข้อมูลโดยตรงจาก url แบบว่า เวลาเข้า page ใดๆ ก็แล้วแต่ มันจะเด้งให้ใส่ username password ตลอด ผมอยากทราบว่า code แบบนั้น เขียนยังไงครับ รบกวนผู้รู้ตอบผมทีน่ะครับ



Tag : - - - -







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2010-07-15 14:09:17 By : chonburi f.c View : 1259 Reply : 9
 

 

No. 1



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

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

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

ลองใช้ Session ครับ หรือไม่ ก็ PHP User Login Authentication MySQL Database






Date : 2010-07-15 14:47:46 By : webmaster
 


 

No. 2



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



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

ขอบคุณคับพี่ วิน
Date : 2010-07-15 15:46:46 By : chonburi f.c
 

 

No. 3



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



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

มีปัญหา อีกอย่างครับ รบกวนช่วยดูให้ผมอีกทีน่ะครับ

คือ พอผมใส่ require_once("checkuser.php"); เข้าไป ทำให้ page มัน error
mysql_fetch_array(): supplied ไม่รู้ว่าเกิดจากอะไร เพราะคำสั่ง sql ผมว่ามันน่าจะถูกแล้ว เพราะตอนยังไม่ได้ใส่คำสั่งนี้เข้าไปใช้งานได้ปกติ
Date : 2010-07-15 16:10:48 By : chonburi f.c
 


 

No. 4



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



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


ขอดู code หน่อยครับ
Date : 2010-07-15 16:13:41 By : aimoomoo
 


 

No. 5



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

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

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

คำสั่ง checkuser เป็นคำสั่งที่ใช้เช็ครหัสผ่านจาก userรึป่าวครับ
Date : 2010-07-15 16:18:12 By : Dragons_first
 


 

No. 6



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

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

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

นี่เป็นฟังค์ชั่น sesion สร้างไฟล์ sesion.php เวลาเรียกใช้ก็ include("session.php"); ไว้ที่หน้าที่ต้องการใช้
<? 
session_start(); 
//ฟังค์ชั่นเวลาของ session
function setSessionTime($_timeSecond){
 if(!isset($_SESSION['ses_time_life'])){
  $_SESSION['ses_time_life']=time();
 }
 if(isset($_SESSION['ses_time_life']) && time()-$_SESSION['ses_time_life']>$_timeSecond){
  if(count($_SESSION)>0){
   foreach($_SESSION as $key=>$value){
    unset($$key);
    unset($_SESSION[$key]);
   }}}}
setSessionTime(30*60);
/// จบส่วนของฟังค์ชั่นเวลา session
if (($_SESSION[username] == "") && ($_SESSION[password] == "")) 
{ 
	echo "<br><br><br><br><link rel=\"stylesheet\" type=\"text/css\" href=\"../css/style.css\">";
	echo "<table width=\"900\" height=\"200\" class=\"redborder\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">
  <tr>
    <td height=\"237\" scope=\"col\" align=center><img src=../../Them/warning.png><br><br><table width=\"100%\" border=\"0\" class=style13 cellspacing=\"0\" cellpadding=\"0\">
  <tr>
    <th scope=\"col\">คุณยังไม่ได้ทำการ Log in เข้าสู่ระบบ กรุณากลับไป Log in เข้ามาใหม่ ก่อนการใช้งานหน้าเว็บนี้<br />โปรดรอสักครู่ ระบบกำลังพาคุณไปที่หน้าแรก เพื่อทำการ Log in เข้าสู่ระบบ Backend ภายใน 5 วินาที</th>
  </tr>
</table><br><img src=../../Them/loading.gif><br><span class=style10>Loadding</span></td>
  </tr>
</table>";
  	echo "<meta http-equiv='refresh' content='5;URL=../index.php'>";
	exit; 
} 
?>

Date : 2010-07-15 16:21:44 By : Dragons_first
 


 

No. 7



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

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

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

หน้า form ดัดแปลงเอาเองนะครับ
<? session_start();?>
<!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>
<link rel="stylesheet" type="text/css" href="css/style.css">
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>Login</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#3b5999">
  <tr>
    <th width="13%" height="60" scope="col">&nbsp;</th>
    <th width="87%" align="left" scope="col" class="style11">OKATOOLS</th>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#eeeff4">
  <tr>
    <th height="50" scope="col">&nbsp;</th>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <th height="85" scope="col">&nbsp;</th>
  </tr>
</table>
<table width="650" height="200" border="0" align="center" cellpadding="0" cellspacing="0" class="border">
  <tr>
    <td scope="col"><table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="35" valign="bottom" scope="col" class="style8"><b>WEBMASTER LOGIN</b></td>
      </tr>
    </table>
      <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td scope="col"><hr /></td>
        </tr>
      </table>
      <table width="100%"  border="0" cellspacing="0" cellpadding="0">
        <tr>
          <th height="25" scope="col">&nbsp;</th>
        </tr>
      </table>
	<? 
		  include("../config/config.inc.php");
		  if(isset($_REQUEST["submit"])){
			session_start();
			session_register("username");
			session_register("password"); 
		  $array=mysql_fetch_array(mysql_query("select * from account where username = '$_REQUEST[username]' and password = '$_REQUEST[password]'"));
		  	if($array== 0){
				$_SESSION["username"]="";
				$_SESSION["password"]="";
	?>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" class="redborder">
        <tr>
        <td height="120" valign="top" scope="col"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td align="left" valign="top" scope="col" class="style10"><span class="style9"><b>Please Login To Amin</b> </span><br />The username you entered does not belong to any account. You may try clearing your browser's cache and cookies by following</td>
          </tr>
        </table>
          <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <th scope="col">&nbsp;</th>
            </tr>
            </table>
          <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td align="left" valign="top" scope="col" class="style10"><span class="style9"><b>กรุณาเข้าสู่ระบบก่อน</b> </span><br />การเข้าใช้งานระบบ Backend ของเว็บไซต์นี้ถือเป็นความลับ สำหรับผู้ที่มีสิทธิ์เข้าใช้งานเท่านั้น ผู้ที่ไม่ได้รับอณุาติ จะไม่มีสิทธิ์เข้าใช้ และหากผู้ไม่มีสิทธิ์้ พยายาม<font color="#FF0000">เข้าระบบโดยไม่ได้รับอณุญาติ (Hack) </font>และพยายามกระทำการฝ่าผืน มีโทษร้ายแรงสูงสุด ตามกฏหมาย</d>
            </tr>
          </table></td>
      </tr>
    </table>
    <?
	}else{ 
				$_SESSION["username"]=$_REQUEST["username"];
				$_SESSION["password"]=$_REQUEST["password"];
  				echo "<meta http-equiv='refresh' content='0;URL=home/index.php'>";
			}
}
	?>
        <form name="Login" method="post" action="<? $_SERVER["PHP_SELF"];?>">
      <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="260" scope="col">&nbsp;</td>
          <td width="340" scope="col">&nbsp;</td>
        </tr>
        <tr>
          <td height="35"  align="right" class="style7" scope="col"><b>Username :&nbsp;</b></td>
          <td scope="col"><input name="username" type="text" size="25" maxlength="50" /></td>
        </tr>
        <tr>
          <td scope="col"  align="right" class="style7"><b>Password :&nbsp;</b></td>
          <td scope="col"><input name="password" type="password" size="25" maxlength="15"/></td>
        </tr>
        <tr>
          <td scope="col">&nbsp;</td>
          <td scope="col">&nbsp;</td>
        </tr>
        <tr>
          <td scope="col">&nbsp;</td>
          <td scope="col"><input name="submit" type="submit"  value="เข้าสู่ระบบ" class="style12" style="background-color:#3b5999; border:hidden;"/></td>
        </tr>
        <tr>
          <td scope="col">&nbsp;</td>
          <td scope="col">&nbsp;</td>
        </tr>
    </table></form>
    </td>
  </tr>
</table>
</body>
</html>

Date : 2010-07-15 16:22:53 By : Dragons_first
 


 

No. 8



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

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

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

เวลา logout ก็ใช้คำสั่งนี้ครับ
<?	
session_start();
session_destroy(); 
$_SESSION["username"] && $_SESSION["password"]=""; 
	echo "<br><br><br><center><img src=../../Them/loading.gif><br><br>คุณได้ทำการออกจากระบบเรียบร้อยแล้ว</center>";
  	echo "<meta http-equiv='refresh' content='2;URL=../../index.php'>";
?>

Date : 2010-07-15 16:24:14 By : Dragons_first
 


 

No. 9



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



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

ขอบคุณทุกคนครับผม แต่ผมใช้ code นี้
Code (PHP)
<?
session_start();

include "connect.php";
require_once("checkuser.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></title>
<link href="normal.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a:link {
	color: #000000;
	text-decoration: none;
}
a:visited {
	color: #000000;
	text-decoration: none;
}
a:hover {
	color: #FF9999;
	text-decoration: none;
}
a:active {
	text-decoration: none;
}

.active{
color:#66CC33;
background:#FFFFFF;
}

.newrefilll{
color:#0099FF;
background:#;
}

.checking{
color: #FF0000;
background:#;
}

.chk{
color: #FF6600;
background:#;
}
.style9 {font-size: 13px}
.style10 {color: #000000}
.style11 {font-size: 13px; color: #FF0000; }
.style14 {color: #FF0000; font-weight: bold; }
.style15 {font-size: 13px; color: #000000; }

-->
</style>
<script type="text/JavaScript">
<!--
function timedRefresh(timeoutPeriod) {
	setTimeout("location.reload(true);",timeoutPeriod);
}
//   -->
</script>
<p>
<body onLoad="JavaScript:timedRefresh(60000);"><!-- กำหนดเวลาในการ Refresh ยิ่งเยอะยิ่งนาน -->

</p>
</div>

</head>

<body>
<p align="center"><img src="img/head1.png" width="900" height="242" /></p>
<table width="900" align="center" cellspacing="1" bordercolor="#FF9FAA">
  <tr align="center" bgcolor="#FF9FAA" class="normal">
    <td colspan="6" bgcolor="#FFFFFF" scope="row"><span class="style11">ตรวจสอบ หมายเลขบัตร true money 14 หลัก </span></td>
  </tr>
  <tr align="center" bgcolor="#FF9FAA" class="normal">
    <td colspan="6" align="left" bgcolor="#FFFFFF" class="style9" scope="row"><a href="logout.php"><span class="style14">|</span> </a><a href="history_back.php">ดูประวัติย้อนหลัง</a><a href="logout.php"> <span class="style14">|</span> </a><a href="logout.php">ออกจากระบบ</a></td>
  </tr>
  <tr align="center" bgcolor="#FF9FAA" class="normal">
    <td colspan="6" align="right" bgcolor="#FFFFFF" scope="row">&nbsp;</td>
  </tr>
  <tr align="center" bgcolor="#FF9FAA" class="normal">
    <td width="61" scope="row">ลำดับ</td>
    <td width="185" scope="row"><span class="style10">username</span></td>
    <td width="100" scope="row"><span class="style10">สถานะ</span></td>
    <td width="220" scope="row">เวลาทำรายการ</td>
    <td width="173" scope="row"><span class="style10">zone การใช้งาน </span></td>
    <td width="140" scope="row"><span class="style10">ตรวจสอบ user </span></td>
  </tr>
  <? 
  
$sql="select * from tb_history where  status='checking'  or status='newrefill' or status='active(chk)'  order by h_id asc ";
$sqlquery=mysql_db_query($dbname,$sql);
while($result= mysql_fetch_array($sqlquery)){

		$hid=$result['h_id'];
		$use=$result['h_username'];

		
		
	if($result["status"]=="active")
	
		{$css = "active";}
	
		elseif ($result["status"]=="newrefill")
	
		{$css = "newrefill";}
		
		elseif ($result["status"]=="active(chk)")
	
		{$css = "chk";}
		
		elseif ($result["status"]=="checking")
	
		{$css = "checking";}
		
		else 
	
		{$css = "";}
	
		
			
?>
  <tr align="center" bgcolor="#F1F1E2" class="<?=$css ?>">
    <td width="61" height="22"><span class="normal style10">
      <?=$result['h_id']?>
    </span></td>
    <td><span class="style15">
      <?=$result['h_username']?>
    </span></td>
    <td width="100" class="<?=$css ?>"><span class="style9">
      <?=$result['status']?>
    </span></td>
    <td width="220" class="<?=$css ?>"><span class="style15">
      <?=$result['h_time']?>
    </span></td>
    <td class="<?=$css ?> style10"><span class="style9">
      <?=$result['h_zone']?>
    </span></td>
    <td width="140" class="<?=$css ?>"><a href="history_edit.php?hid=<?=$hid?>&uname=<?=$use?>"><img src="img/button21.gif" width="70" height="20" border="0" /></a></td>
  </tr>
  <? } ?>
</table>
</body>
</html>



แล้ว มีการสร้าง file checkuser ไว้อีกอัน รบกวนดูให้ทีครบ ขอบคุณทุกคนอีกทีน่ะครับ
Date : 2010-07-15 16:29:40 By : chonburi f.c
 

   

ค้นหาข้อมูล


   
 

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