Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old July 15th, 2004, 08:47 PM
ramsfield ramsfield is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 16 ramsfield User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 52 sec
Reputation Power: 0
Set cookie on click

How can I set a cookie once a user clicks on a link in a page. Basically, the page is a disclaimer page, if they click the link the cookie would be set. If the link is not clicked, then the cookie is not set.

Reply With Quote
  #2  
Old July 15th, 2004, 09:16 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: Set cookie on click

you mean onclick like with javascript, or on click it reloads the page and setcookie() ?

Reply With Quote
  #3  
Old July 15th, 2004, 09:26 PM
ramsfield ramsfield is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 16 ramsfield User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 52 sec
Reputation Power: 0
RE: Set cookie on click

Java script would be fine. I just don't don't know how to write the code. Any help would be appreciated.

Reply With Quote
  #4  
Old July 15th, 2004, 09:33 PM
System System is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Posts: 665 System User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Message Moved

Thread moved from 'PHP Coding' to 'Client Side Things' by notepad.

Reason: :-P

Reply With Quote
  #5  
Old July 15th, 2004, 10:51 PM
ramsfield ramsfield is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 16 ramsfield User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 52 sec
Reputation Power: 0
RE: Set cookie on click

This might work, but would it possible to add a redirect after setting the cookie, this way all the events could happen on one page? Also, what happens if neither yes or no are present. Meaning what if they come to the page without a variable in the URL?

php Code:
Original - php Code
  1.  
  2. <?php
  3. if($_GET['accept']) == "yes")
  4. {
  5. setcookie("masondisclaimer", "yes", time()+60*60*24*30);
  6. REDIRECT HERE
  7. }
  8. else
  9. {
  10. header("Location: mydomain.com");
  11. }
  12. ?> 


<p><a href="disclaimer.php?accept=yes">I accept</a> | <a href="disclaimer.php?accept=no"></p>



Thanks for your help

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Set cookie on click


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway