Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Enabling 2 cookies for 1 page
Old 12-16-2007, 01:31 AM Enabling 2 cookies for 1 page
Junior Talker

Posts: 2
Name: David Miller
Trades: 0
Ok im new to PHP coding and the whole lot, and i need to find a way to accept 2 cookies in vB on one page, it needs to be able to have the regular cookie for the vB login and the secondary cookie for another script that i have wrote inside vB that allows users to change things to an ingame character that they have on a game that i am hosting.

i have complete access to everything on the site, the .htaccess the vB mysql DB and the php config files...so please help me out...
DavidMiller is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-16-2007, 01:43 AM Re: Enabling 2 cookies for 1 page
Extreme Talker

Posts: 238
Location: United States
Trades: 0
Welcome to the forums.

To set a cookie in PHP, the basic syntax is setcookie('cookie_name', 'cookie_value', $time); where $time is the Unix timestamp of when you want the cookie to expire. Note that you have to set cookies before any output is sent to the browser. You can have as many cookies as you want, as long as you give them different names.

To read from a cookie you just need to use $_COOKIE['cookie_name'].

You may find the following site useful for more info on PHP and cookies: http://us2.php.net/setcookie
__________________
The interlocking pieces of web development: usability, performance, accessibility, and standards.
frost is offline
Reply With Quote
View Public Profile
 
Old 12-16-2007, 01:47 AM Re: Enabling 2 cookies for 1 page
Junior Talker

Posts: 2
Name: David Miller
Trades: 0
Thank you for the welcome and the fast reply, i will try this and get back to you thanks again..
DavidMiller is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Enabling 2 cookies for 1 page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23976 seconds with 12 queries