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 : 075806

Guest




Code (PHP)
<?
//============ Customer login check
if($_GET["action"]=="Login")
{
	//============Check customer username and password from table 
	
	require("connect/connect.php");
	$cus_pass = md5($_POST["txtPassSC"]);
	$resultLogin=select("customer","where cus_password='$cus_pass' and cus_email='".$_POST["txtEmailSC"]."'");

	if(!$resultLogin)
	{
						echo '<br> <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FF0000">
              <tr>
                <td bgcolor="#FFFFFF"><font color="red"><center>Username OR Password Incorrect !</font></td>
              </tr>
            </table> ';
	}
	else
	{
				//============  Store customer username and password in the session
					  $_SESSION["strcus_email"]=$_POST["txtEmailSC"];
					  $_SESSION["strcus_password"]=$_POST["txtPassSC"];
					  session_write_close();
					  header("location:index.php");	
	}
}
?>


เราลองรันดู เหมือนกับมันไม่เช็ค if เราทำเครื่องหมายอะไรผิดรูปแบบหรือป่าวนะ


ลองไปลองมาหลายวิธี ส่วนอันนี้ โค๊ดส่ง ฟอร์ม <form action="?action=Login" method="post"> ลองที่ localhost ก็รันปกติ แต่ลองบนโฮสไม่รัน แทนที่ถ้า Login ผิดจะเตือนข้อความขึ้นมาแล้วอยู่ที่หน้าเดิม มันกับข้ามไปที่หน้า index.php เลย ลองมาเปลี่ยนกับไปมาก็ยังไม่ได้ รบกวนช่วยกันเข้ามาดูหน่อยนะคะ่



Tag : PHP, MySQL







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-03-20 03:39:24 By : มือใหม่หัดขับ View : 687 Reply : 2
 

 

No. 1



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

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

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

Code (PHP)
session_start();



หายไปไหนครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-20 06:33:22 By : webmaster
 


 

No. 2

Guest


ใส่ครบทุกอย่างแล้วค่ะ ไม่ได้ copy มาให้ดูทั้งหมด อันนี้โค๊ดจริงๆ ทั้งหน้านะค่ะ

<?
//============ Start Session
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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</style>
<style type="text/css">
<!--
.buttondiv {margin-top: 10px;
}
-->
</style>
</head>
<body>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#333333">
<tr>
<td width="50%" height="38" align="center" bgcolor="#789DD4"><strong>Sign in to your account </strong></td>
<td width="50%" align="center" bgcolor="#789DD4"><strong>New online user </strong></td>
</tr>
</table>
<table width="95%" border="0" cellpadding="0" cellspacing="0" bgcolor="#666666">
<tr>
<td width="49%" height="267" bgcolor="#FFFFFF"><table width="100%" height="306" border="0" cellspacing="0" bgcolor="#000000">
<form action="?action=Login" method="post">
<tr bgcolor="#FFFFFF">
<td height="28" colspan="2" align="left"><div align="left"><br />
<strong>Sign in for faster checkout</strong>. <br />
<br />
</div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="10%" height="62" align="left"><br /></td>
<td width="90%" align="left">Email Address <br />
<input name="txtEmailSC" type="text" id="txtEmailSC" style="background-image:url(images/uauser.gif); background-repeat:no-repeat; border: 1px #CCCCCC solid; padding-left:16px;" value="<?=$_POST["txtEmailSC"];?>" /></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="14" align="left">&nbsp;</td>
<td height="14" align="left">Password <br />
<input name="txtPassSC" type="password" id="txtPassSC" style="background-image:url(images/lock.gif); background-repeat:no-repeat; border: 1px #CCCCCC solid; padding-left:16px;" />

</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="58" colspan="2" align="left"><table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td></td>
</tr>
</table>
<?
//============ Customer login check
if($_GET["action"]=="Login")
{
//============Check customer username and password from table

require("connect/connect.php");
$cus_pass = md5($_POST["txtPassSC"]);
$resultLogin=select("customer","where cus_password='$cus_pass' and cus_email='".$_POST["txtEmailSC"]."'");

if(!$resultLogin)
{
echo '<br> <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FF0000">
<tr>
<td bgcolor="#FFFFFF"><font color="red"><center>Username OR Password Incorrect !</font></td>
</tr>
</table> ';
}
else
{
//============ Store customer username and password in the session
$_SESSION["strcus_email"]=$_POST["txtEmailSC"];
$_SESSION["strcus_password"]=$_POST["txtPassSC"];
session_write_close();
header("location:index.php");
}
}
?><br />

<br />
<input type="checkbox" name="checkbox" value="checkbox" checked="checked"/>
Email me monthly updates and special values available only at ucyiknow. </td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="26" colspan="2" align="center">
<div class="buttondiv">
<input name="Submit" type="submit" id="submit" value="Login" style="margin-left:-10px; height:23px">
</span> </div>
<div align="left"><br />
<a href="#">Can't access your account? </a></div></td>
</tr>
</form>
</table></td>
<td width="2%" align="center" valign="top" background="images/bg_line_stand.gif" bgcolor="#FFFFFF"><span class="style23"><br />
<br />
</span></td>
<td width="49%" align="center" valign="top" bgcolor="#FFFFFF"><table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left"><span class="style23"><br />
If you do not have a ucyiknow.com account, please click &quot;Continue&quot; to register. </span></td>
</tr>
</table>
<span class="style23"> <br />
<input name="button" type="button" class="button" onclick="javascript:location='register1.php'" value="Continue"/>
</span></td>
</tr>
</table>
<hr align="left" width="95%" color="#f2f2f6" />
</body>
</html>


แก้ยังไงก็ไม่ทำงานบนโฮส แต่ทำงานบน Localhost เปลี่ยน Global_register เป็น OFF แล้ว ทำหลายอย่างแล้วใช้ Java alert แทนก็ไม่ทำงาน ทำยังไงก็ไม่ทำงานบนโฮส แต่ทำบน localhost
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-20 12:50:34 By : มือใหม่หัดขับ
 

   

ค้นหาข้อมูล


   
 

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