|
Posted by Tony on 07/08/05 01:56
Taxi Driver wrote:
> I have a MySql table that I select * and display all the results in a
> list on a web page. The web page displays fine. I want to click on
> one item and set a cookie with that id.
>
> I just need some help in setting the cookie when you click on one
> item.
How are you doing it right now?
For the setcookie() function, see http://us3.php.net/setcookie
Cookies have to be set before anything is output to the page, so you'll have
to call a script with the value of the selection. From how you describe it,
it would probably be easiest to do this with GET, then the script would
retrieve that value and set the cookie accordingly:
<?
if (isset($_GET["MyValue"])) { setcookie("My_Value",$_GET["MyValue"]); }
?>
--
Tony Garcia
Web Right! Development
Riverside, CA
www.WebRightDevelopment.com
[Back to original message]
|