|
|
|
ช่วยผมหน่อยคับ ผมเขียนโปรแกรมขายสินค้าโดยใช้ php ครับ แต่ปัญหามันเกิดขึ้นที่ว่าคับ socdcode เดียวกัน |
|
|
|
|
|
|
|
ข้อความที่ขึ้น ERROR มันขึ้นว่าไงคะ เคยเจอสถานการณ์คล้ายๆกันอาจช่วยได้
|
|
|
|
|
Date :
17 ก.พ. 2551 10:56:19 |
By :
apass |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mysql_select_db ($database_conn,$conn)
rsadmin=mysql query($qurery_rsadmin)
ตรง mysql query(...) ลองเขียน mysql_query(...)นะคะ
|
|
|
|
|
Date :
17 ก.พ. 2551 10:58:14 |
By :
apass |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ครับ ขอบคุณมากน่ะคับมันจะเกี่ยวกับเวอร์ชั่นไหมคับ
|
|
|
|
|
Date :
17 ก.พ. 2551 11:46:39 |
By :
jumloon |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php require_once('../Connections/conn.php'); ?>
<?php
//initialize the session
session_start();
// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
$d=date('Y'); if($d>2007){$conn="mysqlconnect";}
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_unregister('MM_Username');
session_unregister('MM_UserGroup');
$logoutGoTo = "../index.php";
if ($logoutGoTo) {
header("Location: $logoutGoTo");
exit;
}
}
?>
<?php
session_start();
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "admin_login.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?php
$colname_rsadmin = "1";
if (isset($_SESSION['MM_Username'])) {
$colname_rsadmin = (get_magic_quotes_gpc()) ? $_SESSION['MM_Username'] : addslashes($_SESSION['MM_Username']);
}
mysql_select_db($database_conn, $conn);
$query_rsadmin = sprintf("SELECT * FROM vcd_admin WHERE admin_user = '%s'", $colname_rsadmin);
$rsadmin = mysql_query($query_rsadmin, $conn) or die(mysql_error());
$row_rsadmin = mysql_fetch_assoc($rsadmin);
$totalRows_rsadmin = mysql_num_rows($rsadmin);
$maxRows_rsmember = 20;
$pageNum_rsmember = 0;
if (isset($_GET['pageNum_rsmember'])) {
$pageNum_rsmember = $_GET['pageNum_rsmember'];
}
$startRow_rsmember = $pageNum_rsmember * $maxRows_rsmember;
mysql_select_db($database_conn, $conn);
$query_rsmember = "SELECT * FROM vcd_member ORDER BY member_id DESC";
$query_limit_rsmember = sprintf("%s LIMIT %d, %d", $query_rsmember, $startRow_rsmember, $maxRows_rsmember);
$rsmember = mysql_query($query_limit_rsmember, $conn) or die(mysql_error());
$row_rsmember = mysql_fetch_assoc($rsmember);
if (isset($_GET['totalRows_rsmember'])) {
$totalRows_rsmember = $_GET['totalRows_rsmember'];
} else {
$all_rsmember = mysql_query($query_rsmember);
$totalRows_rsmember = mysql_num_rows($all_rsmember);
}
$totalPages_rsmember = ceil($totalRows_rsmember/$maxRows_rsmember)-1;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>ยินดีต้อนรับสู่ Pure VCD Center</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<style type="text/css">
<!--
body,td,th {
font-family: Ms Sans Serif, tahoma;
font-size: x-small;
color: #000000;
}
a {
font-family: Ms Sans Serif, tahoma;
font-size: x-small;
color: #FFFFFF;
}
a:link {
text-decoration: none;
color: #FFFFFF;
}
a:visited {
text-decoration: none;
color: #FFFFFF;
}
a:hover {
text-decoration: none;
color: #FF5F00;
}
a:active {
text-decoration: none;
color: #FF5F00;
}
body {
background-image: url();
background-color: #283710;
margin-left: 0px;
margin-top: 0px;
}
.style13 {color: #2A1FAA}
.style14 {color: #AABF00}
.style15 {color: #AA0000}
.style10 {color: #AA0000; font-weight: bold; }
.style12 {color: #FF3F00}
.style16 {color: #FFFBF0}
.style16 {color: #AABF00}
-->
</style>
<script language="Javascript">
<!--
function checkconfirm(id,mess)
{
if(confirm(mess)==true)
{
window.location='admin_member_del.php?memberid='+id+''
}
}
</script>
</head>
<body>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr valign="middle" >
<td colspan="2"><img src="../image/puo.gif" width="100%" height="165"></td>
</tr>
<tr>
<td width="198" height="20" valign="top" background="../images/body2R5C5.jpg" bgcolor="#334515"></td>
<td width="736" rowspan="2" valign="top" bgcolor="#BBC99A"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="99%" height="22" bgcolor="#283710"><div align="right"><a href="admin_member.php">ข้อมูลลูกค้า</a></div></td>
<td width="1%" bgcolor="#283710"> </td>
</tr>
<tr>
<td height="22" colspan="2"> </td>
</tr>
<tr>
<td height="22" colspan="2"><div align="center"><span class="style10"><span class="style12"><img src="../image/b.gif" width="22" height="20"> <span class="style15"> ข้อมูลลูกค้า</span> <img src="../image/b.gif" width="22" height="20"></span></span></div></td>
</tr>
<tr>
<td height="22" colspan="2"> </td>
</tr>
<tr>
<td height="22" colspan="2"> <table width="90%" border="1" align="center" cellpadding="0" bordercolor="#283710">
<tr bgcolor="#BBC99A">
<td width="38%" height="22"><span class="style15"> ขื่อ- นามสกุล</span></td>
<td width="26%"><div align="center" class="style15">โทรศัพท์</div></td>
<td height="22" colspan="2" bgcolor="#BBC99A"><div align="center" class="style15">วันสมัคร</div>
<div align="center" class="style15"></div> <div align="center" class="style15"></div></td>
</tr>
<?php do { ?>
<tr>
<td height="22"> <span class="style13"> <?php echo ''.$row_rsmember['member_fname']; ?> <?php echo ''.$row_rsmember['member_lname']; ?> </span>
<div align="left" class="style13"></div> <div align="left" class="style13"></div> <div align="left" class="style13"></div></td>
<td><div align="center" class="style13"><?php echo $row_rsmember['member_phone']; ?></div></td>
<td width="27%"><div align="center" class="style13"><?php echo $row_rsmember['member_register']; ?></div></td>
<td width="4%" height="22"><div align="center" class="style13"><a href="javascript:checkconfirm('<?php echo $row_rsmember['member_id']; ?>','คุณต้องการลบข้อมูลใช่หรือไม่');"><img src="../img/b_drop.png" width="16" height="16" border="0"></a></div></td>
</tr>
<?php } while ($row_rsmember = mysql_fetch_assoc($rsmember)); ?>
</table></td>
</tr>
</table> </td>
</tr>
<tr>
<td height="11" valign="top" background="../images/body2R6C5.jpg" bgcolor="#334515">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="22" colspan="2"><div align="center"><span class="style15"><img src="../image/peo.gif" width="23" height="22"> เกี่ยวกับ
Admin <img src="../image/peo.gif" width="23" height="22"></span></div></td>
</tr>
<tr>
<td width="13%"><div align="right"><img src="../image/arrow.png" width="12" height="12"></div></td>
<td width="87%" height="22"> <a href="admin_info.php">ข้อมูลระบบ</a></td>
</tr>
<tr>
<td><div align="right"><img src="../image/arrow.png" width="12" height="12"></div></td>
<td height="22"> <a href="admin_member.php">ข้อมูลลูกค้า</a></td>
</tr>
<tr>
<td><div align="right"><img src="../image/arrow.png" width="12" height="12"></div></td>
<td height="22"> <a href="admin_item.php">ข้อมูลสินค้า</a></td>
</tr>
<tr>
<td><div align="right"><img src="../image/arrow.png" width="12" height="12"></div></td>
<td height="22"><a href="admin_rent.php"> บันทึกรายการซื้อตุ๊กตา</a></td>
</tr>
<tr>
<td><div align="right"><img src="../image/arrow.png" width="12" height="12"></div></td>
<td height="22"> <a href="admin_type.php">รายการประเภทตุ๊กตา</a></td>
</tr>
<tr>
<td height="22"><div align="right"><img src="../image/arrow.png" width="12" height="12"></div></td>
<td height="22"> <a href="admin_order.php">รายการซื้อตุ๊กตา</a></td>
</tr>
<tr>
<td height="22"><div align="right"><img src="../image/arrow.png" width="12" height="12"></div></td>
<td> <a href="admin_order_send.php">รายการตุ๊กตาที่ซื้อไปแล้ว</a></td>
</tr>
<tr>
<td><div align="right"><img src="../image/arrow.png" width="12" height="12"></div></td>
<td height="22"> <a href="admin_news.php">รายการข่าวประชาสัมพันธ์</a></td>
</tr>
<tr>
<td><div align="right"><img src="../image/arrow.png" width="12" height="12"></div></td>
<td height="22"> <a href="admin_webboard.php">กระดานข่าว</a></td>
</tr>
<tr>
<td><div align="right"><img src="../image/arrow.png" width="12" height="12"></div></td>
<td height="22"> <a href="admin_poll.php">แบบสำรวจ</a></td>
</tr>
<tr>
<td><div align="right"><img src="../image/arrow.png" width="12" height="12"></div></td>
<td height="22"> <a href="admin_admin.php">เปลี่ยนรหัสผ่าน</a></td>
</tr>
<tr>
<td><div align="right"><img src="../image/arrow.png" width="12" height="12"></div></td>
<td height="22"><a href="<?php echo $logoutAction ?>"> ออกจากระบบ</a></td>
</tr>
</table>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
<tr bgcolor="#798E4D" background="../images/body2R1C2.jpg">
<td height="25" background="../images/body2R1C2.jpg" > </td>
<td height="25" background="../images/body2R1C2.jpg" > </td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($rsadmin);
mysql_free_result($rsmember);
?>
mysql_select_db($database_conn, $conn); mysql_select_db($database_conn, $conn); $rsadmin = mysql_query($query_rsadmin, $conn) or die(mysql_error());
|
|
|
|
|
Date :
17 ก.พ. 2551 11:50:28 |
By :
jumloon |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ที่ผมขีดเส้นใต้กับตัวหนังสือสีแดงน่ะคับ
|
|
|
|
|
Date :
17 ก.พ. 2551 11:51:30 |
By :
jumloon |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|