gemme session i cookie
Hej eksperterJeg har en side som kører en session.
Når jeg så går ind på en anden side, som jeg kalder via en anden server for at få den til at køre ssl, så forsvinder min session. For at oprette min session skal jeg så bruge HTTP_COOKIE. Hvordan gør jeg det på en side der ser sådan her ud:
Kører fra denne her side: (jeans.php)
********************************
<?php
// Include MySQL class
require_once('cart/inc/mysql.class.php');
// Include database connection
require_once('cart/inc/global.inc.php');
// Include functions
require_once('cart/inc/functions.inc.php');
// Start the session
session_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>LUXundPUNK - Jeans</title>
<link rel="stylesheet" type="text/css" href="mystyle2.css" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
<![endif]-->
</head>
<body>
<div id="home2">
<div id="lpshop">
<p class="style11">Jeans <form action="index.php" method="submit"><button type="submit">Tilbage til forretning</button></form></p>
</div>
<div id="kurv"><?php echo writeShoppingCart(); ?></div><br>
<div id="del">
<?php
$sql = 'SELECT * FROM toej2 WHERE del = "Jeans" AND lager > 0 ORDER BY id';
$result = $db->query($sql);
while ($row = $result->fetch()) {
$output[] = '<table border=1 cellpadding=1 cellspacing=0 borderColor=black>';
$output[] = '<tr>';
$output[] = '<td width=50px><p align="center" class="style12">'.$row['del'].'</p></td>';
$output[] = '<td width=100px><p class="style12">Mærke:<br>'.$row['maerke'].'</p></td>';
$output[] = '<td width=100px><p class="style12">Model:<br>'.$row['model'].'</p></td>';
$output[] = '<td width=70px><p class="style12">Størrelse:<br>'.$row['str'].'</p></td>';
$output[] = '<td width=40px><img src="../pics/thumb'.$row['id'].'.jpg"></td>';
$output[] = '<td width=110px><p class="style12">DKK: '.$row['pris'] = number_format($row['pris'], 2, ",", ".").'</p></td>';
$output[] = '<td><a href="cart/cart.php?action=add&id='.$row['id'].'"><img src="../indkoebskurv.gif" border="0"></a></td>';
$output[] = '</tr>';
$output[] = '</table><br>';
}
echo join('',$output);
?><br>
</div>
</div>
</body>
</html>
*****************************
og via et link til denne her side: (indkobskurv.php)
********************************
<?php
// Include MySQL class
require_once('cart/inc/mysql.class.php');
// Include database connection
require_once('cart/inc/global.inc.php');
// Include functions
require_once('cart/inc/functions.inc.php');
// Start the session
session_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>LUXundPUNK - Din indkøbskurv</title>
<link rel="stylesheet" type="text/css" href="mystyle2.css" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
<![endif]-->
</head>
<body>
<div id="home2">
<div id="lpshop">
<p class="style11">Indkøbskurv</p>
</div>
<div id="del">
<?php
echo showCart();
?>
</div>
</div>
</body>
</html>
******************************
