Reply
Grab part of URL and turn into session variable
Old 02-04-2009, 02:28 PM Grab part of URL and turn into session variable
Junior Talker

Posts: 4
Trades: 0
My apologies in advance if my request is not well formed as I'm not familiar with PHP. Actually, I'm a designer not a coder but the site in question is using PHP.

My client needs to pass a URL parameter found in Google ad links to a form that the visitor may submit (a reservation form).

Example:

http://www.domain.com/?gclid=COfArNPHw5gCFRlcagodrjoF2w

Seems to me I need to somehow grab the 'gclid', create a session and then and store the ID in the session so if the visitor submits the reservation form, it can get passed along.

So if this makes sense, I need to understand how to achieve this. If this is beyond the scope of this forum, I understand completely. Thanks for helping a 'noob'.
mrixi is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 02-04-2009, 10:00 PM Re: Grab part of URL and turn into session variable
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,578
Name: Keith Marshall
Location: West Hartford, CT
Trades: 0
At the top of the php pages, add this:

PHP Code:
<?php
  
  session_start
();
  
  if (isset(
$_GET['gclid']) AND !isset($_SESSION['gclid'])) $_SESSION['gclid'] = $_GET['gclid'];
  
?>
 
Rest of page contents...
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 02-05-2009, 11:17 AM Re: Grab part of URL and turn into session variable
Junior Talker

Posts: 4
Trades: 0
Thank you for your reply mgraphic -- I'll give it a try. Cheers.
mrixi is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Grab part of URL and turn into session variable
 

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.08869 seconds with 13 queries