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
Grab part of URL and turn into session variable
Old 02-04-2009, 03: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
 
 
Register now for full access!
Old 02-04-2009, 11:00 PM Re: Grab part of URL and turn into session variable
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,898
Name: Keith Marshall
Location: Connecticut
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, 12:17 PM 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.14911 seconds with 12 queries