Please help me,save and get cookies by Javascript
Posted: Sun Dec 03, 2006 7:23 am
feyd | Please use [/syntax]
But the $gay does not have the value I want (the msValue)
Please help me asap.thks much
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Howdy php experts and specialists,
I have a problem in the thing that i want to save a pair of value to cookie by Javascript and then I get it up and assign to a variable in php code
[syntax="javascript"]<script language ="javascript">
function setCook(msValue) // msValue is a variable that has a certain value
{
var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
document.cookies = bien + "=" + msValue +
((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}
</script> Code: Select all
<?php
// assign the value which i get it up from cookie to $gay in php
$gay = $_COOKIE['bien']; // is that right???Here i want to get the "msValue" value which I had saved it to cookiePlease help me asap.thks much
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]