php3-list | 2000051

Re: [PHP3] Cookie Confusion .. From: Allen Francom (aef <email protected>)
Date: 05/15/00

Ideally, IDEALLY, you do not want to set cookies with such values.

YOU REALLY WANT A DATABASE.

That said, the idea in general is to SET AN ID in a cookie.

Cookies are set in the HTTP Headers BEFORE page data
starts getting processed.

<?
  setcookie();

  echo "<html><head><title>Boo! </title></head><body><p>Hello</p></body</html>\n"; ?>

?>

Like that, but you put parameters into setcookie();

If you set an ID, and store the temporary data somewhere, Database, File,
or SHARED MEMORY if mod_php is being used, then the id COMES
BACK TO YOU the next time the user requests any page and you can
GO to the FILE or DATABASE or SHARED MEMORY and GET
whatever the ID references.

You get the cookie as a regular variable automagickally.

If you set a cookie named "BOB", the next time the user requests anything
the variable $BOB will contain a value, majick.

Read the freaking manual - if someone hasn't said that already ;)-

http://www.php.net

THX
-AEF

On Mon, 15 May 2000, Christian wrote:
> Hi all,
>
> I have a situation where I collect user details via a form ..
> I do not wish to enter them into MySQL straight away ..
> As further processing, collection and validation has to be done ..
> Therefore if one area fails no entry will be made ..
> So I need a way of temp storing this data over multiple pages ..
>
> I thought of setting a cookie .. But am having problems ...
> What is the procedure for setting a cookie to form contents ..
> --> where is the setcookie code() called, current or called page ?
>
> Can someone please help with the cookie code ..
> Or maybe suggest a better way of temp storing the form data ..
>
> Thanks heaps,
>
> --

-- 
"If you think the Universe is big, you should see the source code..."
-Frank & Ernest

-- PHP 3 Mailing List <http://www.php.net/> To unsubscribe, send an empty message to php3-unsubscribe <email protected> To subscribe to the digest, e-mail: php3-digest-subscribe <email protected> To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-admin <email protected>