Forum Moderators: open

Message Too Old, No Replies

How do I?

URL Cookie thingy...

         

Galdas

5:15 am on Dec 23, 2004 (gmt 0)

10+ Year Member



Yeah... I'm making an online Christmas card.

What I want is for someone to send the URL to a friend, and have in the mid section "To whoever," when the reciever opens it. This is to be done through the use of a cookie placed in the URL.
I know that, what I don't know is how to do it.
I'm pretty sure I saw a tutorial on how to do it, but I can't find it anymore.

Could someone please direct me to one?
OR and I HATE asking this:
Tell me the syntax

Thanks a heap. :)

[edited by: DrDoc at 12:13 am (utc) on Dec. 28, 2004]
[edit reason] No URLs, thanks. See TOS [WebmasterWorld.com] [/edit]

RonPK

3:58 pm on Dec 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello Galdas, welcome to WebmasterWorld.

There is no such thing as a cookie in a URL. A cookie is a piece of information that gets sent by a server in an HTTP header. The client stores it as a file (IE) or puts it into a larger cookie-file (other browsers). If it's a temporary cookie it won't be stored at all.

What you might try is to create URLs like this:

domain.tld/card.php?name=Jack%20Jones

and then let a server side script parse the URL and display the name.

Galdas

1:32 pm on Dec 24, 2004 (gmt 0)

10+ Year Member



Yes, That's what I wanted... although The data isn't transfered in a linear pattern... That was part of the problem.

Thanks!

[edited by: DrDoc at 12:14 am (utc) on Dec. 28, 2004]

adni18

2:29 pm on Dec 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



so you want to get the info variables from the address bar?


page.html?cardid=8462974928&simplifiedtextimput=Jack+Jones

adni18

2:52 pm on Dec 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




<script language="javascript">
<!--

stones=window.location.href.split("?")[1].split("&");
for(var i=0;i<stones.length;i++)
{
rocks=stones[i].split("=");

var x=rocks[0];
var y=rocks[1];
alert(x+" = "+y);

}

//-->
</script>

Galdas

2:18 pm on Dec 26, 2004 (gmt 0)

10+ Year Member



THANKYOU! :)

Erm, one tiny little thing though... where exactly do I put this, and how do I link the text in the textbox to the URL?

THANKS A LOT! :P

adni18

3:12 am on Dec 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You put the script in the window that will read the variables from the URL, and as for the textbox thing, do you want the user to type in a URL and have jscript open it in a popup window?

Galdas

4:17 pm on Dec 27, 2004 (gmt 0)

10+ Year Member



No... They write a name, and the words from the text box defines what info is called up in the page.

Sorry for the trouble :)

chriswragg

10:32 pm on Dec 27, 2004 (gmt 0)

10+ Year Member



If you create a form that uses the GET method:

<form name="example" method="GET" action="yourpage.htm">

This would submit the data as:

.../yourpage.htm?input1=abc&input2=123

Hope this helps

Galdas

11:50 pm on Dec 27, 2004 (gmt 0)

10+ Year Member



Thankyou, it does :)