Forum Moderators: coopster

Message Too Old, No Replies

How to pass unique affiliate id in url parameters in Joomla

affiliate id in url

         

suneva

11:37 pm on Jul 5, 2009 (gmt 0)

10+ Year Member



Hello:

I am building Joomla 1.5 sites for a client and I have two problems. First the client wants the affiliate tracking code BEFORE the domain name, like this:

[affiliate_ID.example.com...]

What is the code and syntax needed so that whatever the affiliate id is, it will be incorporated into the URL and then the results stored in the MySQL database? I need to know how to get this done ASAP. The client does not want to create subdomains.

The second problem is I need a script that will capture and validate the information from a page: the url of the page, the response to a survey question, the person's name and email. This information needs to be stored in the database as well.

Thanks for your help in advance.

[edited by: coopster at 6:00 pm (utc) on July 6, 2009]
[edit reason] please use example.com, thanks! [/edit]

andrewsmd

8:23 pm on Jul 6, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Post your code and I can help you more, right now it's impossible to see how you are getting any of your data to validate it. For starters, however, lets say you are storing the affiliate's id in the session("id") variable. On whatever page example.com is do this at the very beginning.
<?php
session_start();
if(session("id)){
Header("location: [affiliate{$id}.example.com");...]
}
//else we redirect to an error page saying the id was not recognized
else{
header("Location: http://example.com/error.php");
}