Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 6th Jun 2011, 05:23 PM   #1
Adxhibit.com
War Room Member
 
Wealthyclark's Avatar
 
Join Date: 2009
Posts: 664
Thanks: 72
Thanked 114 Times in 74 Posts
Default
Please help me with code to pass affiliate id's to affiliate signup form
Share on: 
fb share twitter share gplus share more share

Hello, I recently setup my new affiliate program and I need to pass the affiliate's id from my home page and place it into the affiliate signup form so that it will credit current affiliates with the referal when their visitors want to also become affiliates. Basically the sales cookie is set on the home page, it tracks and credits affiliate sales but I also want new affiliates that signup to be placed under the person that referred them to my site. I already have the software setup with the signup form on my site, I just need the code that makes the form pass the referal id to the affiliate sofware and credit the correct affiliate. Here is an example of the signup form:

Code:
<form action='https://www.osiaffiliate.com/affiliateprogram/users/register2.php' method='post' onsubmit='return checkvalidation();' name='signupform'>
<input type=hidden name=sinup_id value=4><span style="color: rgb(211, 211, 211);">
 * First Name:   <input type=text name='sinup_z_First_Name_' value=""  size=40><br>

 * Last Name:   <input type=text name='sinup_z_Last_Name_' value=""  size=40><br>

 * Email:   <input type=text name='sinup_z_Email_' value=""  size=40><br>

 * Choose Password:   <input type=password name='sinup_z_Choose_Password_' value=""  size=40><br>

 * Confirm Password:   <input type=password name='sinup_z_Confirm_Password_' value=""  size=40><br>

  Company:   <input type=text name='sinup_z_Company_' value=""  size=40><br>

  Paypal Email to Pay Commission:   <input type=text name='sinup_z_Paypal_Email_to_Pay_Commission_' value=""  size=40><br>

  Address:   <input type=text name='sinup_z_Address_' value=""  size=40><br>

  Address 2:   <input type=text name='sinup_z_Address_2_' value=""  size=40><br>

  City:   <input type=text name='sinup_z_City_' value=""  size=40><br>

  State/Province:   <input type=text name='sinup_z_State_Province_' value=""  size=40><br>

  Zip:   <input type=text name='sinup_z_Zip_' value=""  size=40><br>

  Phone:   <input type=text name='sinup_z_Phone_' value=""  size=40><br>

 * Email Format:   <select name=sinup_z_Email_Format_><option value='1'  >HTML</option>
<option value='2'  >Text</option>
</select><br>

  Name to use on Check:   <input type=text name='sinup_z_Name_to_use_on_Check_' value=""  size=40><br>

  Payment Preference:   <select name=sinup_z_Payment_Preference_><option value=''  >- None -</option>
<option value='1'  >Check</option>
<option value='2'  >PayPal</option>
</select><br>

  Tax ID:   <input type=text name='sinup_z_Tax_ID_' value=""  size=40><br>

  Title:   <input type=text name='sinup_z_Title_' value=""  size=40><br>

<input type=submit name=check value='Submit'></form>
<script type="text/javascript">
 function checkvalidation(){

var str=document.forms['signupform'].sinup_z_First_Name_.value;
                                            if(!str)
                                            {
                                             alert('Please enter First Name ');
                                             return false;
                                            }
                                            
var str=document.forms['signupform'].sinup_z_Last_Name_.value;
                                            if(!str)
                                            {
                                             alert('Please enter Last Name ');
                                             return false;
                                            }
                                            
var emailFilter=/^.+@.+\..{2,3}$/;
                                            var str=document.forms['signupform'].sinup_z_Email_.value;
                                            if(!str)
                                            {
                                             alert('Please enter email Id');
                                             return false;
                                            }
                                            else if(!(str.match(emailFilter))) {
                                               alert('Please enter valid email');
                                              return false;
                                             }
var str=document.forms['signupform'].sinup_z_Choose_Password_.value;
                                            if(!str)
                                            {
                                             alert('Please enter Choose Password ');
                                             return false;
                                            }
                                            
var str=document.forms['signupform'].sinup_z_Confirm_Password_.value;
                                            if(!str)
                                            {
                                             alert('Please enter Confirm Password ');
                                             return false;
                                            }
                                            
var str=document.forms['signupform'].sinup_z_Email_Format_.value;
                                            if(!str)
                                            {
                                             alert('Please enter Email Format ');
                                             return false;
                                            }
                                            
 }
 </script>
Here is an example of the landing page code:

Code:
<script type="text/javascript">
<!--
document.write(unescape("%3Cscript id='omniaff_o789258' src='" + (("https:" == document.location.protocol) ? "https://" : "http://") +
"www.osiaffiliate.com/affiliateprogram/track.js' type='text/javascript'%3E%3C/script%3E"));//-->
</script>
Here is an example of the thank you page code:

Code:
<script>
function hideIF() {   
document.getElementById('IF').style.display = '';
}
function getSaleInfo() {
document.getElementById('st_code').innerHTML='<iframe src="https://www.osiaffiliate.com/affiliateprogram/salejs.php?amount=.00&transaction=B" alt="" id=IF width=50 height=50 border="0" frameborder="0" onload="hideIF()">';
}
window.onload = getSaleInfo;
</script></p>
<div id="st_code">&nbsp;</div>
Wealthyclark is offline  
Unread 6th Jun 2011, 06:21 PM   #2
HyperActive Warrior
War Room Member
 
ussher's Avatar
 
Join Date: 2010
Location: Tokyo
Posts: 314
Thanks: 27
Thanked 43 Times in 42 Posts
Default
Re: Please help me with code to pass affiliate id's to affiliate signup form
Share on: 
fb share twitter share gplus share more share

to help you we need to know where your affiliate's id is stored.

If the link they are coming in on is direct to your signup page and is in the url like:
http:://yoursite.com/signup.php?affiliate_id=12

then you can take the variable $_GET['affiliate_id'] and put it into a hidden form on your signup page.

The simplest being:
<input type=hidden name="sub_affiliate_id" value="<?php echo $_GET[''affiliate_id]?>">

but that will only work if the id is in the URL.

With affiliate programs, sometimes they have a cookie period where any signup is valid for that period, in which case the affiliate id will be stored in the database, or maybe in a cookie and it might also be available from the $_SESSIONS['affiliate_id'] too.

"Jamroom is a Profile Centric CMS system suitable as a development framework for building entire communities. Highly modular in concept. Suitable for enterprise level development teams or solo freelancers."
- jamroom.net
Download Jamroom free: Download
ussher is offline  
Unread 6th Jun 2011, 06:45 PM   #3
Adxhibit.com
War Room Member
 
Wealthyclark's Avatar
 
Join Date: 2009
Posts: 664
Thanks: 72
Thanked 114 Times in 74 Posts
Default
Re: Please help me with code to pass affiliate id's to affiliate signup form
Share on: 
fb share twitter share gplus share more share

Thanks for attempting to help me Ussher, here is an example of what original referral links look like but I have integrated the form into my site so the id is not in the URL.

Code:
https//osiaffiliate.com/affiliateprogram/users/main.php?ref=1029
Wealthyclark is offline  
Unread 6th Jun 2011, 07:03 PM   #4
HyperActive Warrior
War Room Member
 
ussher's Avatar
 
Join Date: 2010
Location: Tokyo
Posts: 314
Thanks: 27
Thanked 43 Times in 42 Posts
Default
Re: Please help me with code to pass affiliate id's to affiliate signup form
Share on: 
fb share twitter share gplus share more share

Thinking again, the place i would probably put it is not in the form itself anyhow. I would check for it in register2.php.

In the place that processes the form.

In the place that processes the form find some code that can retrieve the affiliate id and put that into a variable
$affiliate_id = (whatever the code that is needed to get this variable place here.)

then add that variable directly into the submitted form processing.

This way the user has no way of tampering with it while they are signing up. (unless you want them to see the affiliate id of the guy who sent them there at signup.)

so you (still) need go looking for some code that wants to check for the affiliate id so you can copy that over to the registration form.

"Jamroom is a Profile Centric CMS system suitable as a development framework for building entire communities. Highly modular in concept. Suitable for enterprise level development teams or solo freelancers."
- jamroom.net
Download Jamroom free: Download
ussher is offline  
Unread 7th Jun 2011, 01:32 PM   #5
Adxhibit.com
War Room Member
 
Wealthyclark's Avatar
 
Join Date: 2009
Posts: 664
Thanks: 72
Thanked 114 Times in 74 Posts
Default
Re: Please help me with code to pass affiliate id's to affiliate signup form
Share on: 
fb share twitter share gplus share more share

Thanks ussher, I'm waiting for the software owner to give me ftp access to the files so I can get those variables. I hope can figure this out because I would hate for someone to charge me $100 bucks for what I believe to be a five minute job for someone with experience.

I could be wrong about the five minute assumption but I usually do this type of stuff myself fairly easy and I have no experience. I just couldn't figure this one out but that might be due to not being supplied with the correct variables needed.
Wealthyclark is offline  
Unread 7th Jun 2011, 09:26 PM   #6
HyperActive Warrior
War Room Member
 
ussher's Avatar
 
Join Date: 2010
Location: Tokyo
Posts: 314
Thanks: 27
Thanked 43 Times in 42 Posts
Default
Re: Please help me with code to pass affiliate id's to affiliate signup form
Share on: 
fb share twitter share gplus share more share

I usually find that most jobs are "five minute jobs" but that it can take hours to figure out what is going on.

So the final solution could be as simple as "change that 0 to a 1" but that it took 5 hours of setting up debugging systems and walking through the code to come to that conclusion.

So if you can find someone who knows the code, that always helps things go smooter.

"Jamroom is a Profile Centric CMS system suitable as a development framework for building entire communities. Highly modular in concept. Suitable for enterprise level development teams or solo freelancers."
- jamroom.net
Download Jamroom free: Download
ussher is offline  
Unread 9th Jun 2011, 05:18 AM   #7
Adxhibit.com
War Room Member
 
Wealthyclark's Avatar
 
Join Date: 2009
Posts: 664
Thanks: 72
Thanked 114 Times in 74 Posts
Default
Re: Please help me with code to pass affiliate id's to affiliate signup form
Share on: 
fb share twitter share gplus share more share

Here is two more codes I found, I think this may be what I need. Can you tell me if I'm on the right track with this.

Code:
var getready = false;
function GetData() {
	if(getready==true) {
	var data1 = getFlashMovie("updateFlData").getOne("affiliate_id");
	var data2 = getFlashMovie("updateFlData").getOne("prodgroup");
	document.getElementById("affiliate").value = data1;
	document.getElementById("prodgroup").value = data2;
	document.frmsale.submit();
	
//	document.cookie = "aff_id"+"="+data1;
//	document.cookie = "p_id"+"="+data2;
 }
}
Code:
<input type=hidden name=f_ref value=>
I'm not sure if I need both of these codes in the form or how I should correctly use them to get the outcome I'm looking for.
Wealthyclark is offline  
Unread 11th Jun 2011, 01:51 AM   #8
HyperActive Warrior
War Room Member
 
ussher's Avatar
 
Join Date: 2010
Location: Tokyo
Posts: 314
Thanks: 27
Thanked 43 Times in 42 Posts
Default
Re: Please help me with code to pass affiliate id's to affiliate signup form
Share on: 
fb share twitter share gplus share more share

The first piece of code is javascript, so no.
The second piece of code is Html, so no.

You'll want to add PHP code to https://www.osiaffiliate.com/affilia.../register2.php

The code for retrieving the affiliate id is probably not already in there, so you will need to locate a file that does retrieve the affiliate code and bring that over to register2.php

"Jamroom is a Profile Centric CMS system suitable as a development framework for building entire communities. Highly modular in concept. Suitable for enterprise level development teams or solo freelancers."
- jamroom.net
Download Jamroom free: Download
ussher is offline  
Unread 13th Jun 2011, 07:11 AM   #9
Warrior Member
 
Join Date: 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: Please help me with code to pass affiliate id's to affiliate signup form
Share on: 
fb share twitter share gplus share more share

well it'll be easier if you try coding in PHP...

victorjames is offline  
Closed Thread


Bookmarks

Tags
affiliate, code, form, pass, signup


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




All times are GMT -6. The time now is 04:04 PM.