Using strings in cookies?
Posted: Thu Aug 05, 2010 6:46 am
Hi
I am having troubles using a string in a cookie..
This doesnt work:
Neither does this:
If I write something before $image_name like:
It will save "hello" in the cookie.. So in other words, $image_name doesnt look like it is defined.. But the funny thing is that this works on the same page:
Anyone have any idea on what I am doing wrong?
I am having troubles using a string in a cookie..
This doesnt work:
Code: Select all
setcookie("background", "$image_name", $expire, "/", ".gedoo.com");Code: Select all
setcookie("background", "" . $image_name . "", $expire, "/", ".gedoo.com");Code: Select all
setcookie("background", "hello" . $image_name . "", $expire, "/", ".gedoo.com");Code: Select all
echo "File Uploaded Successfully!<br><img src='images/$image_name'>";