how to Create a cookie in drupal to store GET params from referer

bizbez

Registered Member
Joined
Jan 26, 2011
Messages
86
Reaction score
3
Hi all,
On drupal 7.8 I use webform module, which on every submission , I want to send as hidden value, a GET params (e.g. ?ref=[param]). This Get parameter is coming from referring sites, so I want to send this info on every form submission.

I have two questions:
1. How and where do I store this GET parameter in a cookie? (which file etc?)
2. How do I display this info in the webform (special tokens area)?
I just cant find where do I write this special cookie.

Thanks,
 
I never used Drupal so I don't know how much of a help this would be, but have you looked at PHP's setcookie function?

Code:
setcookie('your_cookie_name', $_GET['name'])

$cookie_value = $_COOKIE('your_cookie_name');
 
@cnick79 - thanks for the detailed reply.
in PHP i know the drill, but how and where to place this on drupal - thats my problem since its OOP , i'm not sure where i can add my unique cookie storage.
 
Back
Top