?
Solved

Referrer ID's being passed page to page

Posted on 2003-03-02
14
Medium Priority
?
225 Views
Last Modified: 2008-02-26
Hi,

checkout http://www.xcensus.com

I would like to be able to pass a variable such as www.xcensus.com?affid=0111 to any page on my site and for it to get picked up on the signup pages, whats the best way to achieve this, and the code needed to make the idea work ?  

Regards
0
Comment
Question by:MirageSF
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
  • +1
14 Comments
 
LVL 15

Accepted Solution

by:
VGR earned 400 total points
ID: 8051732
possibility :
on start of each page :
if (isset($_GET["affid"])) {
  $affid=$_GET["affid"];
  Header("Location: yoursignup.php?affid=$affid");
} // if transmitted via GET (in the URI)
0
 
LVL 1

Expert Comment

by:KC_Speedball
ID: 8051740
the best and cleanest (not the easiest) way is to use session.


the code will be like this:

<?php
session_start();
register_session('affid');


$_SESSION['affid'] = 0111;

for the first page

any other page have to contain

<?php
session_start();
register_session('affid');

and than you can you $_SESSION['afid'] in the script consisting the value from the first page
0
 
LVL 1

Expert Comment

by:KC_Speedball
ID: 8051743
Again VGR *grrr* the fastest coder on earth :). Rien ne va plus! Thanks for learning from you.
0
WordPress Tutorial 3: Plugins, Themes, and Widgets

The three most common changes you will make to your website involve the look (themes), the functionality (plugins), and modular elements (widgets).

In this article we will briefly define each again, and give you directions on how to install them.

 
LVL 15

Expert Comment

by:VGR
ID: 8051758
not at all the fastest 8-)
just the one working also on Sunday :D
0
 
LVL 1

Expert Comment

by:KC_Speedball
ID: 8051765
it looks like working 24 hours 7 days a week for me
0
 

Author Comment

by:MirageSF
ID: 8051768
Hmm, but surely the first method would be forgotten if they moved to another page ?  Hows about a cookie, as I would also like it to remember that affid for 30 days from when its first visited ?

Regards
0
 
LVL 1

Expert Comment

by:KC_Speedball
ID: 8051783
never worked with cookies. job for VGR
0
 
LVL 6

Expert Comment

by:carchitect
ID: 8052202
yeah but cookie is not reliable....
but for your purpose cookie is the only solution...
regards
0
 
LVL 15

Expert Comment

by:VGR
ID: 8052400
absolutely not, carchitect !
Cookies (I mean EXPLICIT cookies) are the WORST solution I would try. Only in Despair would I use them.

Sessions ***usually*** involve cookies too (or files on the server)

if they go to another page, id doesn't change anything because you redirect to the "signup page" anyway. I thought you wanted the affid to be transmitted forward, but if you don't, no problem, it's even simplier :
if (isset($_GET["affid"])) {
 Header("Location: yoursignup.php");
} // if transmitted via GET (in the URI)

this way ANYTIME affid is sent via the (direct) URL, the browser is redirected to yoursignup.php

That's what you asked for, isn't it ? :D
0
 

Author Comment

by:MirageSF
ID: 8055408
Erm....  They will always be sent to http://www.xcensus.com/index.php?affid=(anynumber)

Then I really need this number stored for upto 30 days, so if that person visits the site during that time again without including the ?affid bit then when they move throughout the site and eventually sign up, the affid originaly number is picked up from their machine somehow.
0
 
LVL 15

Expert Comment

by:VGR
ID: 8055484
30 days --> cookies only. Nor for me.

sessions won't last that long, and are closed when changinf browser's instance, so in 30 days and given Zindoze 's ability to "blouscrine"... Around 120 sessions in 30 days :D

you could have stated this in your originalquestion. I answered it 100% and now that was not what you wanted !

"ce qui se concoit bien s'enonce clairement,
et les mots pour le dire viennent aisement."
0
 

Author Comment

by:MirageSF
ID: 8055545
Sorry, youre right, I was just tired ! :)
0
 
LVL 6

Expert Comment

by:carchitect
ID: 8055575
VGR i know cookie is worst and i never use it personally...
ha ha
0
 
LVL 15

Expert Comment

by:VGR
ID: 8055745
thanks, I'll cool down... perhaps adding some heat sinks to my exoskeleton...
0

Featured Post

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question