0
我已經把我的域中medieland.dk/plakat/ 兩個文件,這些被稱爲designer_kids.php和vejledning.php如何用一個PHP文件設置一個cookie並用另一個PHP文件讀取它?
我想保存在designer_kids JavaScript Cookie進行一些數據和vejledning閱讀。 PHP
designer_kids.php:
<script>
document.cookie = 'sel=color1jpg; expires=Thu, 2 Aug 2001 20:47:11 UTC; path=/plakat/; domain=.medieland.dk';
$(document).ready(function(){
$('#right').css("background-image", "url(pictures/color1.jpg)");
$("#color1").click(function(){
$('#right').css("background-image", "url(pictures/color1.jpg)");
});
$("#color2").click(function(){
$('#right').css("background-image", "url(pictures/color2.jpg)");
});
$("#color3").click(function(){
$('#right').css("background-image", "url(pictures/color3.jpg)");
});
});
</script>
vejledning.php:
<?php
echo "her kommer teksten <p> </p>";
echo $_COOKIE["sel"];
?>