Forum Moderators: phranque

Message Too Old, No Replies

Carrying user info from one page to another

How to carry an email address to a subscription page

         

chokky

10:52 am on Nov 16, 2002 (gmt 0)

10+ Year Member



On my site, subscribers can enter their email address on the front page. What's the best way to carry that email address to another page where they enter other details before subscribing?

Thanks :)

jatar_k

5:26 pm on Nov 16, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Hi chokky,

I would say you have two choices, cookies or sessions.

I think a cookie would be the easiest, they fill in the address and you can pop it into a cookie. When they get to the extra info page you can grab it out of there when they submit it.

shady

5:50 pm on Nov 16, 2002 (gmt 0)

10+ Year Member



Before using a cookie/session variable, don't you need to post the data to another page?

redzone

6:36 pm on Nov 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Shady,
No, the cookie get's set when the initial page is served, (or whatever URL, from where you want to begin tracking)..

Then the cookie get's pulled from the headers, when you parse the subscription information from the form data.
The cookie data is always passed, because of the way the browser software interacts with the web server.

Of course, if the browser has Cookies turned off, you get zippo, which is why many networks prefer SessionID tracking. But SessionID tracking requires dynamic serving of content.

shady

6:45 pm on Nov 16, 2002 (gmt 0)

10+ Year Member



>> parse the subscription information from the form data

Thats what I meant :) So you can only process the information once it is posted from the form to the processing page.

Once on the second page which receives the data posted from the form, you can then save it to a cookie etc..

Maybe I am misunderstanding the question - I wasn't clear whether chokky is already processing the email data, or whether this facility is in the process of being added

gsx

8:53 pm on Nov 16, 2002 (gmt 0)

10+ Year Member



And if you use cookies - view www.p3ptoolbox.org/guide otherwise IE 6 may refuse them...

chokky

7:38 pm on Nov 17, 2002 (gmt 0)

10+ Year Member



Thanks all!
I'll go for the cookies option, and then change to SessionID when I get round to creating dynamic pages.
Thanks again,

Chokky

phollings

3:37 pm on Nov 18, 2002 (gmt 0)

10+ Year Member



Assuming that you get to the second page by clicking a link, a graphic, etc., why not put the link between <form> tags and send the email address as a hidden variable ( <input Type="hidden"> )? Wouldn't this be the simplest way?

:)

BlobFisk

4:38 pm on Nov 18, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



phollings, you got in there before me! :)

To add - you can then grab the form info using a server side language such as ASP, PHP etc. with a Request.Form("email") command (example in ASP). The action of your form would be the page that grabs the form info.

The one thing I would say about this is, that as soon as the user hits Submit they will be brought to the next page - which may not be what is desired.... That leaves Cookies and SessionID!