【php开源代码栏目提醒】:网学会员为需要php开源代码的朋友们搜集整理了printorder.php相关资料,希望对各位网友有所帮助!
<?php
if (!empty($_GET['orderid'])) {
$orderid=$_GET['orderid'];
}
$cookie_info = explode("-", $_COOKIE['cookie_info']);
$customerid = $cookie_info[1];
include("settings.php");
include("index.php");
$db = mysql_connect($dblocation,$dbuser,$dbpass) or die(mysql_error());
mysql_select_db($dbname,$db) or die(
mysql_error());
// lets check if the order you are trying to read is REALLY your own order
$query = "SELECT * FROM `orders` WHERE ID = '" . $orderid . "'";
$sql = my
sql_query($query) or die(mysql_error());
while ($row = mysql_fetch_row($sql)) {
$webid = $row[7];
$ownerid = $row[4];
}
if ($ownerid != $customerid && IsAdmin() == false) {
exit;
}
$fp = fopen($orders_dir."/".$webid, "rb") or die("Couldn't open order");
$order = fread($fp, filesize($orders_dir."/".$
webid));
fclose($fp);
$result = nl2br($order);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<title><?php echo $webid ?></title>
</head>
<body bgcolor=white onLoad="javascript:window.print()">
<?php echo $result ?>
</body>
</html>