Link to home
Create AccountLog in
Avatar of LearningLearning
LearningLearning

asked on

Remember visitor arrival referral url then used inside website?

Hi

I am with Joomla CMS.
Some of the menu I have in my sites are
a, Main, Blog, FAQ, Join For Free

I wish to create a simple affiliate program which let my affiliate to promote through link at this format
http://www.domain.com/ref/ABC123 <- Affiliate Code (and this is the format I need)
All of the people who came through this link, will arrive at www.domain.com.
They might browse around the site e.g FAQ, Blog etc
Once they decided to join, they will click on "Join For Free".
The Join for free link will be
http://www.domain.com/join/XXXXXXX (which is ABC123) if the person arrived the site by typing http://www.domain.com, this will be filled with default value.
So how can I achieve this?
Remember the person affiliate code using cookies?
One a person click on Join then check the cookies and fill in the value?
I am open to any suggestion.
Apologize if I didnt my question clear. I am happy to clarify my enquiry
Thanks

Avatar of paulp75
paulp75
Flag of Australia image

sorry i don't have the time to write the full code for this
use php's explode function to extract the affiliate code
http://au3.php.net/explode
store it as cookie. then pass to join url
http://au.php.net/substr
probably could use this
sorry responding with a baby on my lap.
Avatar of Kiran Paul VJ
First thing you should do is trap the url http://www.domain.com/ref/ABC123 

otherwise Page not found error will be showed. For traping the url use Url Rewriting

http://www.sitepoint.com/article/guide-url-rewriting
http://corz.org/serv/tricks/htaccess2.php

so you can get your referrer ABC123, store it in a session or hidden field or cookie, or where you like and access this whenever needed.

hope these helps
kiranvj
ASKER CERTIFIED SOLUTION
Avatar of pupson
pupson

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer