Anonymous visitors presented with variables

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
mesz
Forum Contributor
Posts: 216
Joined: Fri May 23, 2003 8:11 am
Location: M/cr

Anonymous visitors presented with variables

Post by mesz »

A mate who knows that I build simple websites asked me to help him with something that he presumed would be simple to build.............................and so the trouble began...
He wants a website where visitors choose 1 option for 4 possible factors and then an image is displayed from these 4 chosen variables and a text version of these choices is also displayed and emailed to him and them.

This sounds simple doesn't it?

I can build the form with radio buttons, I can write the variables to a db, I can also, I think ( though I've never done it ) create a dynamic url from the variables so that it links to one of 16 or so preloaded images made up of all possible variables.

However, how the hell do you show the vistor what they have selected after they press submit?

What I mean is -
as anonymous visitors to the site they won't have logged in and so I can't assign them a session ID ( can I? ).
Nor could I just show them the last record in the db, as 10 or 1000 people could be using the site at one time and pressing submit at once.
Nor can I rely on cookies as these might be disabled client-side.
I'm also told by another mate that does all his work like this from behind an authenticated gateway that you can't always rely on IP addresses as it is possible for a server to send all users out onto the internet with an identical IP...I didn't know this.

So how do you do it with php!

How do people build sites like this, where anonymous visitors are presented with a screen that shows the options they have just selected...obviously it can be done...look at Amazon.

Thanks for any help that you can afford me.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Re: Anonymous visitors presented with variables

Post by timvw »

mesz wrote: as anonymous visitors to the site they won't have logged in and so I can't assign them a session ID ( can I? )
use http://www.php.net/session_start
User avatar
mesz
Forum Contributor
Posts: 216
Joined: Fri May 23, 2003 8:11 am
Location: M/cr

Post by mesz »

Thanks man. That's gonna be a god send.
Cheers
Post Reply