Anne Vance
10-15-2003, 08:09 AM
Hello,
Again I need some help.
On one page with photos I have the script:
<script language="JavaScript" type="text/javascript">
<!--
document.write("bestelde foto @ " + document.location);
// -->
</script>
this produces:
bestelde foto @ http://www.blablabla.be/photo_album/./gal_1/006_01.jpg which is correct and what I want.
Now I make a cookie:
<script type="text/javascript">
<!--
function write_cookie()
{
var verval =1000*60*60*24;
var nu = new Date();
var vervaltijd = new Date(nu.getTime() +
verval);
vervaltijd = vervaltijd.toGMTString() ;
document.cookie ="bestelling="+ document.location +
"; expires=" + vervaltijd + ";" ;
}
// -->
</script>
And on the form (next page) where I read the cookie
<input type="text" size=70 value="<?php echo $_COOKIE['bestelling']; ?>" name="bestelling">
Iget the result:
http://www.blablabla.be/photo_album/?gal=1&pic=1
So the cookie reads the location in the list of photos and not the url where the name of the jpg is shown.
How come and how can I fix this. ?
Again I need some help.
On one page with photos I have the script:
<script language="JavaScript" type="text/javascript">
<!--
document.write("bestelde foto @ " + document.location);
// -->
</script>
this produces:
bestelde foto @ http://www.blablabla.be/photo_album/./gal_1/006_01.jpg which is correct and what I want.
Now I make a cookie:
<script type="text/javascript">
<!--
function write_cookie()
{
var verval =1000*60*60*24;
var nu = new Date();
var vervaltijd = new Date(nu.getTime() +
verval);
vervaltijd = vervaltijd.toGMTString() ;
document.cookie ="bestelling="+ document.location +
"; expires=" + vervaltijd + ";" ;
}
// -->
</script>
And on the form (next page) where I read the cookie
<input type="text" size=70 value="<?php echo $_COOKIE['bestelling']; ?>" name="bestelling">
Iget the result:
http://www.blablabla.be/photo_album/?gal=1&pic=1
So the cookie reads the location in the list of photos and not the url where the name of the jpg is shown.
How come and how can I fix this. ?