Jump to content

How would I got about putting an affiliate username on my site?


agentk

Recommended Posts

Hi

Question:

 

Say my website is: mygreatempire.com and I am wanting to implant a referral code on that page.  How would I go about it? 

As an example, I want my referral URL to look somthing like this: mygreatempire.com?ws=?????

 

How can I make "?????" (or whatever else I put there) show on my site?  Basically what my site is going to say is: "You were referred by ?????".  I want to be able to implant any name whatsover where the ????? is right now.

 

I looked at implanting cookies... but have no clue how I would go about doing that.  I am a semi newbie when it comes to php.  Any help?

 

Any suggestions? 

 

Figuring this out would make 2008 my best year yet.  Thanks in advance!

Link to comment
Share on other sites

no problems.. for future reference.. if you have

 

index.php?page=home&view=normal

 

you use

 

$_GET[''];

 

to get whats after the ?

 

whatever you have before the = enter between the single quotes so above you would have

 

$page = $_GET['page'];

$view = $_GET['view'];

 

hope this helps

Link to comment
Share on other sites

Very good. That makes a lot of sense... and I understand it now. Thanks again!

 

But...

 

I just remembered: Can I have a default display? Assuming somebody does not provide a username, I would need $ws to display a default username. Is that at all possible?

 

I would assume the formula would be something like:

 

if 'ws' = blank, $ws = DefaultUsername

 

No?

Link to comment
Share on other sites

maybe just to clarify... the reason I need the value of $ws to change is because I will also be implanting it into a hidden input text field of a form.  If that wasn't the case, I guess I could always just have a different echo... but in this case it obviously would not work.

Link to comment
Share on other sites

I think what you need is:

 

$ws = $_GET['ws'];

if (!$ws) {
echo "No referall ID entered!";
}
else {
echo "Referall from :".$ws;
}

 

the first part sets the WS to a variable called $ws, the if statemnt checks if $ws has a value, if not it says "no referall ID entered" and if it does then it gives the second message.

Link to comment
Share on other sites

I think that is just what I need... however, when I implant it, why does it not read $ws code by itself on the php page?

 

I tried planting $ws by itself in the middle of the page... (apart from the code) yet it displays the following message:

 

Parse error: syntax error, unexpected T_STRING in /home/mygreate/public_html/index.php on line 13

 

Here is what I need it to do on my page:

 

 

<input type="hidden" name="$ws">

 

 

Basically... $ws has to have a value at all times.  Shouldn't that somehow work?

Link to comment
Share on other sites

ok great!

 


<table border='0' cellspacing='0' cellpadding='10' bordercolor='#cccccc'>
<td>
<center>
<form method='post' action='http://www.aweber.com/scripts/addlead.pl' name='form' onsubmit='return checkForm()'>
 <input type='hidden' name='unit' value='kdbraun'>
 <input type='hidden' name='redirect' value='http://www.WebSite.ws/kdbraun'>
 <input type='hidden' name='meta_redirect_onlist' value='http://www.WebSite.ws/kdbraun'>
 <input type='hidden' name='meta_adtracking' value='leads'>
 <input type='hidden' name='meta_message' value='1'>
 <input type='hidden' name='meta_required' value='from'>
 <input type='hidden' name='meta_forward_vars' value='1'>
 <input type='hidden' name='referralID' value='$ws'>


<table border='0' cellpadding='0' cellspacing='0'>
 <tr>
   <td nowrap>
     <div align='center'><strong><font face='Tahoma' size='2'>Your Email Adress:</font></strong>
     </div>
<input type='text' name='from' value='email' size='30' /></td></td>
 </tr>
</table>
<input type='submit' value='Watch Video Now!'>
</form>
</center>
</td>
</table>
</center>

 

I got it all working except for the

  <input type='hidden' name='affiliate' value='$ws'>

 

I'm thinking I might have to create two complete sites within each each of the two echos to pull up... is there any way around it?

 

This is what I am thinking:

 

<?php

$ws = $_GET['ws'];

if (!$ws) {
echo "page1";
}
else {
echo "page2 :".$ws;
}

?>

 

It can be done but if there is a way to do it differently... I'd rather go that root. I hate working within echos :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.