|
|
|
มีปัญหาเกี่ยวกับ session เมื่อนำขึ้น host บางหน้ามองหา session ไม่เจอครับ PHP/MYSQL |
|
|
|
|
|
|
|
ลองแล้วครับยังไม่ได้เลย ขอคำแนะนำเพิ่มเติมด้วยนะครับ ขอบคุณมากครับ
|
|
|
|
|
Date :
2014-05-07 14:19:38 |
By :
Pitsarut |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอดันนะครับ ยังหาทางไม่ได้เลย
|
|
|
|
|
Date :
2014-05-07 17:25:57 |
By :
Pitsarut |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขออนุญาติดันอีกรอบนะครับยังแก้ไม่ได้เลยครับ
|
|
|
|
|
Date :
2014-05-07 21:18:28 |
By :
Pitsarut |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code อยู่ไหนอะครับ
|
|
|
|
|
Date :
2014-05-07 21:33:51 |
By :
dreamt256 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ส่วนมาก host จะปิดการแจ้งเตือน error ไว้ครับ ลองเพิ่มใน .htaccess ไฟล์ เพื่อบังคับให้แสดง error แล้วจึงหาวิธีแก้ไขครับ
php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on
|
|
|
|
|
Date :
2014-05-07 21:43:28 |
By :
praranut_125 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอดูการเซ็ตค่าให้เซสชั่น กับวิธีเรียกเซสชั่นมาใช้หน่อยสิครับ
|
|
|
|
|
Date :
2014-05-07 21:44:51 |
By :
{Cyberman} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ถ้าทำส่วน header แยกกันคนละไฟล์กับ body<HTML> ก็ควรเอา session_start(); ไว้ที่ไฟล์ header นะครับ ถ้าเป็นอย่างที่ผมว่าก็ลองเปลี่ยนดูนะ
|
|
|
|
|
Date :
2014-05-08 09:24:58 |
By :
geidtiphong |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ผมไม่ค่อยอยากตอบ guest ก็เพราะเค้ามาโพสต์ลอย ๆ แล้วไม่ตามงาน ตอบไปก็เพลีย
|
|
|
|
|
Date :
2014-05-08 09:55:48 |
By :
apisitp |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขออภัยด้วยครับ เหมือน code จะยาวไป
นี่หน้า login ครับ
Code
<?php require_once('Connections/DBShop.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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;
}
}
mysql_select_db($database_DBShop, $DBShop);
$query_employee = "SELECT Emp_uname FROM employees";
$employee = mysql_query($query_employee, $DBShop) or die(mysql_error());
$row_employee = mysql_fetch_assoc($employee);
$totalRows_employee = mysql_num_rows($employee);$colname_employee = "-1";
if (isset($_POST['uname'])) {
$colname_employee = $_POST['uname'];
}
mysql_select_db($database_DBShop, $DBShop);
$query_employee = sprintf("SELECT Emp_uname FROM employees WHERE Emp_uname = %s", GetSQLValueString($colname_employee, "text"));
$employee = mysql_query($query_employee, $DBShop) or die(mysql_error());
$row_employee = mysql_fetch_assoc($employee);
$totalRows_employee = mysql_num_rows($employee);
?>
<?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['uname'])) {
$loginUsername=$_POST['uname'];
$password=$_POST['pwd'];
$MM_fldUserAuthorization = "Emp_Status";
$MM_redirectLoginSuccess = "orders.php";
$MM_redirectLoginFailed = "Login.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_DBShop, $DBShop);
$LoginRS__query=sprintf("SELECT Emp_uname, Emp_pwd, Emp_Status FROM employees WHERE Emp_uname=%s AND Emp_pwd=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $DBShop) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = mysql_result($LoginRS,0,'Emp_Status');
if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && false) {
$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=utf-8" />
<title>Login</title>
</head>
<body>
<form id="form1" name="form1" method="POST" action="<?php echo $loginFormAction; ?>">
<table width="264" border="1" align="center" cellpadding="1">
<tr>
<th colspan="2" scope="col">Log In System</th>
</tr>
<tr>
<td width="42%">User Name :</td>
<td width="58%" align="center"><input type="text" name="uname" id="uname" /></td>
</tr>
<tr>
<td>Password :</td>
<td align="center"><input type="password" name="pwd" id="pwd" /></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="asd" id="asd" value="LogIn" /></td>
</tr>
</table>
</form>
</body>
</html>
<?php
mysql_free_result($employee);
?>
|
|
|
|
|
Date :
2014-05-08 13:45:15 |
By :
Pitsarut |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code
<?php require_once('Connections/DBShop.php'); ?>
<?php
session_start();
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
for($i=0;$i<count($_POST['orderno'])&&$_POST['orderno'][$i];$i++){
$insertSQL = sprintf("INSERT INTO orders (emp_uname, orderno, `order`, type, style, Orderlength, color, price, pricetrans, namedetail, orderdate, orderweek) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['orderuname'], "text"),
GetSQLValueString($_POST['orderno'][$i], "int"),
GetSQLValueString($_POST['order'][$i], "text"),
GetSQLValueString($_POST['type'][$i], "text"),
GetSQLValueString($_POST['style'][$i], "text"),
GetSQLValueString($_POST['orderlength'][$i], "text"),
GetSQLValueString($_POST['color'][$i], "text"),
GetSQLValueString($_POST['price'][$i], "int"),
GetSQLValueString($_POST['pricetrans'][$i], "int"),
GetSQLValueString($_POST['namedetail'][$i], "text"),
GetSQLValueString($_POST['orderdate'], "date"),
GetSQLValueString($_POST['week'], "int"));
mysql_select_db($database_DBShop, $DBShop);
$Result1 = mysql_query($insertSQL, $DBShop) or die(mysql_error());
}
$_SESSION['MM_Ordername'] = $orderuname;
$_SESSION['MM_OrderWeek'] = $week;
$insertGoTo = "tank.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
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>Orders</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
</head>
<body>
<form id="form1" name="form1" method="POST" action="<?php echo $editFormAction; ?>">
<table width="40%" border="1" align="center" cellpadding="0">
<tr>
<th bgcolor="#555" colspan="9" scope="col"><div align="center"><strong>ใบสั่งซื้อสินค้า Week ที่ :
<input type="text" name="week" id="week" />
รหัสตัวแทน :
<input type="text" name="orderuname" id="orderuname" value="<?php echo $_SESSION['MM_Username']; ?>"/>
วันที่ :
<input type="text" name="orderdate" id="datepicker" />
</strong></div></th>
</tr>
<tr align="center">
<td width="3%" height="27">No.</td>
<td width="5%">รายการ</td>
<td width="5%">ผูก/หนีบ</td>
<td width="5%">ตรง/ลอน</td>
<td width="5%">สั้น/ยาว</td>
<td width="5%">สี</td>
<td width="5%">ราคา</td>
<td width="5%">ค่าส่ง</td>
<td width="62%">ชื่อ-ที่อยู่</td>
</tr>
<tr align="center">
<td><input name="orderno[]" type="text" id="orderno[]" size="5" /></td>
<td><input name="order[]" type="text" id="order[]" size="10" /></td>
<td><input name="type[]" type="text" id="type[]" size="10" /></td>
<td><input name="style[]" type="text" id="style[]" size="10" /></td>
<td><input name="orderlength[]" type="text" id="orderlength[]" size="10" /></td>
<td><input name="color[]" type="text" id="color[]" size="10" /></td>
<td><input name="price[]" type="text" id="price[]" size="10" /></td>
<td><input name="pricetrans[]" type="text" id="pricetrans[]" size="10" /></td>
<td><textarea name="namedetail[]" cols="50" id="namedetail[]"></textarea></td>
</tr>
<tr align="center">
<td><input name="orderno[]" type="text" id="orderno[]" size="5" /></td>
<td><input name="order[]" type="text" id="order[]" size="10" /></td>
<td><input name="type[]" type="text" id="type[]" size="10" /></td>
<td><input name="style2[]" type="text" id="style2[]" size="10" /></td>
<td><input name="orderlength[]" type="text" id="orderlength[]" size="10" /></td>
<td><input name="color[]" type="text" id="color[]" size="10" /></td>
<td><input name="price[]" type="text" id="price[]" size="10" /></td>
<td><input name="pricetrans[]" type="text" id="pricetrans[]" size="10" /></td>
<td><textarea name="namedetail[]" cols="50" id="namedetail[]"></textarea></td>
</tr>
<tr align="center">
<td><input name="orderno[]" type="text" id="orderno[]" size="5" /></td>
<td><input name="order[]" type="text" id="order[]" size="10" /></td>
<td><input name="type[]" type="text" id="type[]" size="10" /></td>
<td><input name="style[]" type="text" id="style[]" size="10" /></td>
<td><input name="orderlength[]" type="text" id="orderlength[]" size="10" /></td>
<td><input name="color[]" type="text" id="color[]" size="10" /></td>
<td><input name="price[]" type="text" id="price[]" size="10" /></td>
<td><input name="pricetrans[]" type="text" id="pricetrans[]" size="10" /></td>
<td><textarea name="namedetail[]" cols="50" id="namedetail[]"></textarea></td>
</tr>
<tr align="center">
<td><input name="orderno[]" type="text" id="orderno[]" size="5" /></td>
<td><input name="order[]" type="text" id="order[]" size="10" /></td>
<td><input name="type[]" type="text" id="type[]" size="10" /></td>
<td><input name="style[]" type="text" id="style[]" size="10" /></td>
<td><input name="orderlength[]" type="text" id="orderlength[]" size="10" /></td>
<td><input name="color[]" type="text" id="color[]" size="10" /></td>
<td><input name="price[]" type="text" id="price[]" size="10" /></td>
<td><input name="pricetrans[]" type="text" id="pricetrans[]" size="10" /></td>
<td><textarea name="namedetail[]" cols="50" id="namedetail[]"></textarea></td>
</tr>
<tr align="center">
<td><input name="orderno[]" type="text" id="orderno[]" size="5" /></td>
<td><input name="order[]" type="text" id="order[]" size="10" /></td>
<td><input name="type[]" type="text" id="type[]" size="10" /></td>
<td><input name="style[]" type="text" id="style[]" size="10" /></td>
<td><input name="orderlength[]" type="text" id="orderlength[]" size="10" /></td>
<td><input name="color[]" type="text" id="color[]" size="10" /></td>
<td><input name="price[]" type="text" id="price[]" size="10" /></td>
<td><input name="pricetrans[]" type="text" id="pricetrans[]" size="10" /></td>
<td><textarea name="namedetail[]" cols="50" id="namedetail[]"></textarea></td>
</tr>
<tr align="center">
<td><input name="orderno[]" type="text" id="orderno[]" size="5" /></td>
<td><input name="order[]" type="text" id="order[]" size="10" /></td>
<td><input name="type[]" type="text" id="type[]" size="10" /></td>
<td><input name="style[]" type="text" id="style[]" size="10" /></td>
<td><input name="orderlength[]" type="text" id="orderlength[]" size="10" /></td>
<td><input name="color[]" type="text" id="color[]" size="10" /></td>
<td><input name="price[]" type="text" id="price[]" size="10" /></td>
<td><input name="pricetrans[]" type="text" id="pricetrans[]" size="10" /></td>
<td><textarea name="namedetail[]" cols="50" id="namedetail[]"></textarea></td>
</tr>
<tr align="center">
<td><input name="orderno[]" type="text" id="orderno[]" size="5" /></td>
<td><input name="order[]" type="text" id="order[]" size="10" /></td>
<td><input name="type[]" type="text" id="type[]" size="10" /></td>
<td><input name="style[]" type="text" id="style[]" size="10" /></td>
<td><input name="orderlength[]" type="text" id="orderlength[]" size="10" /></td>
<td><input name="color[]" type="text" id="color[]" size="10" /></td>
<td><input name="price[]" type="text" id="price[]" size="10" /></td>
<td><input name="pricetrans[]" type="text" id="pricetrans[]" size="10" /></td>
<td><textarea name="namedetail[]" cols="50" id="namedetail[]"></textarea></td>
</tr>
<tr align="center">
<td><input name="orderno[]" type="text" id="orderno[]" size="5" /></td>
<td><input name="order[]" type="text" id="order[]" size="10" /></td>
<td><input name="type[]" type="text" id="type[]" size="10" /></td>
<td><input name="style[]" type="text" id="style[]" size="10" /></td>
<td><input name="orderlength[]" type="text" id="orderlength[]" size="10" /></td>
<td><input name="color[]" type="text" id="color[]" size="10" /></td>
<td><input name="price[]" type="text" id="price[]" size="10" /></td>
<td><input name="pricetrans[]" type="text" id="pricetrans[]" size="10" /></td>
<td><textarea name="namedetail[]" cols="50" id="namedetail[]"></textarea></td>
</tr>
<tr align="center">
<td><input name="orderno[]" type="text" id="orderno[]" size="5" /></td>
<td><input name="order[]" type="text" id="order[]" size="10" /></td>
<td><input name="type[]" type="text" id="type[]" size="10" /></td>
<td><input name="style[]" type="text" id="style[]" size="10" /></td>
<td><input name="orderlength[]" type="text" id="orderlength[]" size="10" /></td>
<td><input name="color[]" type="text" id="color[]" size="10" /></td>
<td><input name="price[]" type="text" id="price[]" size="10" /></td>
<td><input name="pricetrans[]" type="text" id="pricetrans[]" size="10" /></td>
<td><textarea name="namedetail[]" cols="50" id="namedetail[]"></textarea></td>
</tr>
<tr align="center">
<td><input name="orderno[]" type="text" id="orderno[]" size="5" /></td>
<td><input name="order[]" type="text" id="order[]" size="10" /></td>
<td><input name="type[]" type="text" id="type[]" size="10" /></td>
<td><input name="style[]" type="text" id="style[]" size="10" /></td>
<td><input name="orderlength[]" type="text" id="orderlength[]" size="10" /></td>
<td><input name="color[]" type="text" id="color[]" size="10" /></td>
<td><input name="price[]" type="text" id="price[]" size="10" /></td>
<td><input name="pricetrans[]" type="text" id="pricetrans[]" size="10" /></td>
<td><textarea name="namedetail[]" cols="50" id="namedetail[]"></textarea></td>
</tr>
<tr align="center">
<td colspan="9"><input type="submit" name="bttsubmit" id="bttsubmit" value="สั่งซื้อ" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
</form>
</body>
</html>
|
|
|
|
|
Date :
2014-05-08 13:49:47 |
By :
Pitsarut |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php require_once('Connections/DBShop.php'); ?>
<?php
session_start();
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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($_SESSION['MM_Ordername'])) {
$colname_Recordset1 = $_SESSION['MM_Ordername'];
}
$colname2_Recordset1 = "0";
if (isset($_SESSION['MM_OrderWeek'])) {
$colname2_Recordset1 = $_SESSION['MM_OrderWeek'];
}
mysql_select_db($database_DBShop, $DBShop);
$query_Recordset1 = sprintf("SELECT * FROM orders WHERE emp_uname = %s AND orderweek = %s", GetSQLValueString($colname_Recordset1, "text"),GetSQLValueString($colname2_Recordset1, "int"));
$Recordset1 = mysql_query($query_Recordset1, $DBShop) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
$maxRows_Recordset2 = 10;
$pageNum_Recordset2 = 0;
if (isset($_GET['pageNum_Recordset2'])) {
$pageNum_Recordset2 = $_GET['pageNum_Recordset2'];
}
$startRow_Recordset2 = $pageNum_Recordset2 * $maxRows_Recordset2;
$colname_Recordset2 = "-1";
if (isset($_SESSION['MM_Ordername'])) {
$colname_Recordset2 = $_SESSION['MM_Ordername'];
}
$colname2_Recordset2 = "0";
if (isset($_SESSION['MM_OrderWeek'])) {
$colname2_Recordset2 = $_SESSION['MM_OrderWeek'];
}
mysql_select_db($database_DBShop, $DBShop);
$query_Recordset2 = sprintf("SELECT sum(price),sum(pricetrans),count(orderno),SUM( price + pricetrans ) as total FROM orders WHERE emp_uname = %s AND orderweek = %s", GetSQLValueString($colname_Recordset2, "text"),GetSQLValueString($colname2_Recordset2, "int"));
$query_limit_Recordset2 = sprintf("%s LIMIT %d, %d", $query_Recordset2, $startRow_Recordset2, $maxRows_Recordset2);
$Recordset2 = mysql_query($query_limit_Recordset2, $DBShop) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
if (isset($_GET['totalRows_Recordset2'])) {
$totalRows_Recordset2 = $_GET['totalRows_Recordset2'];
} else {
$all_Recordset2 = mysql_query($query_Recordset2);
$totalRows_Recordset2 = mysql_num_rows($all_Recordset2);
}
$totalPages_Recordset2 = ceil($totalRows_Recordset2/$maxRows_Recordset2)-1;
?>
<!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>ShowOrder</title>
<style type="text/css">
#table1 tr td {
text-align: center;
}
#table2 tr td {
text-align: center;
}
</style>
</head>
<body>
<table border="1" align="center" cellpadding="1" cellspacing="1" id="table1">
<tr id="table1" bgcolor="#00CCCC">
<td width="162">รหัสตัวแทน</td>
<td width="137">No.</td>
<td width="122">รายการสินค้า</td>
<td width="115">ประเภท</td>
<td width="116">รูปแบบ</td>
<td width="161">ความยาว</td>
<td width="120">สี</td>
<td width="119">ราคา</td>
<td width="148">ค่าส่ง</td>
<td width="153">ชื่อและที่อยู่</td>
<td width="148">วันที่สั่งซื้อ</td>
<td width="153">รอบที่สั่งซื้อ</td>
</tr>
<?php
do {
// จุดไคลแม็กอยู่ตรงนี้ เอาจำนวนรอบในการลูปหารเอาเศษ ด้วย 2
$iLoop++;
$bgcolor = ( ($iLoop%2)==0 )? "#99CCFF" : "#FFFFFF" ;
?>
<tr bgcolor="<?php echo $bgcolor ;?>">
<td><?php echo $row_Recordset1['emp_uname']; ?></td>
<td><?php echo $row_Recordset1['orderno']; ?></td>
<td><?php echo $row_Recordset1['order']; ?></td>
<td><?php echo $row_Recordset1['type']; ?></td>
<td><?php echo $row_Recordset1['style']; ?></td>
<td><?php echo $row_Recordset1['Orderlength']; ?></td>
<td><?php echo $row_Recordset1['color']; ?></td>
<td><?php echo $row_Recordset1['price']; ?></td>
<td><?php echo $row_Recordset1['pricetrans']; ?></td>
<td><?php echo $row_Recordset1['namedetail']; ?></td>
<td><?php echo $row_Recordset1['orderdate']; ?></td>
<td><?php echo $row_Recordset1['orderweek']; ?></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<p> </p>
<table border="1" align="center" cellpadding="1" cellspacing="1" id="table2">
<tr>
<td bgcolor="#CC9900" colspan="4">สรุปยอดที่ต้องโอนมา</td>
</tr>
<tr bgcolor="#FFFF66">
<td>จำนวนสินค้า</td>
<td>ราคาสินค้าทั้งหมด</td>
<td>ราคาค่าส่งทั้งหมด</td>
<td>ราคารวม</td>
</tr>
<?php do { ?>
<tr>
<td bgcolor="#66FFFF"><?php echo $row_Recordset2['count(orderno)']; ?> ชิ้น</td>
<td bgcolor="#CCFF00"><?php echo $row_Recordset2['sum(price)']; ?> บาท</td>
<td bgcolor="#CCFF00"><?php echo $row_Recordset2['sum(pricetrans)']; ?> บาท</td>
<td bgcolor="#FF3333"><?php echo $row_Recordset2['total']; ?> บาท</td>
</tr>
<?php } while ($row_Recordset2 = mysql_fetch_assoc($Recordset2)); ?>
</table>
<p><?php echo $_SESSION['MM_Ordername']; ?></p>
<?php echo $_SESSION['MM_OrderWeek']; ?>
</body>
</html>
<?php
mysql_free_result($Recordset1);
mysql_free_result($Recordset2);
?>
|
|
|
|
|
Date :
2014-05-08 13:50:48 |
By :
Pitsarut |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
หน้าสุดท้ายคือหน้าที่มีปัญหาครับ ไม่สามารถรับ session Usename กับ OrderWeek ได้ครับ
|
|
|
|
|
Date :
2014-05-08 13:54:46 |
By :
Pitsarut |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Array ( [MM_Username] => admin [MM_UserGroup] => ADMIN [MM_Ordername] => [MM_OrderWeek] => )
หน้าที่ 2 รับค่า ของ MM_Username ได้เป็น admin ครับ
หน้าที่ 3 รับค่าไม่ได้ครับ [MM_Ordername] => [MM_OrderWeek] =>
|
|
|
|
|
Date :
2014-05-08 15:53:30 |
By :
Pitsarut |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Array ( [MM_Username] => admin [MM_UserGroup] => ADMIN [MM_Ordername] => admin [MM_OrderWeek] => 7 )
ส่วนนี่ผม test จาก ในเครื่องครับ
|
|
|
|
|
Date :
2014-05-08 16:01:10 |
By :
Pitsarut |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|