0

So I'm a newbie and I do know some HTML and PHP. Don't get too advanced on me though.

I have a page like this mywebsite.com/?s1=affiliateid

I want to take the affiliateid part out of the URL. Every affiliate will put a different username into the address.

Then I want to create a link will point to differentwebsite.com/?id=affiliateid based on the username typed into the address bar.

I know I have to define s1 somewhere. I don't know how this works. Can anyone help me?

Bryan Spector
  • 27
  • 2
  • 11

1 Answers1

1

You'll want to look at adding a $_GET variable to the mywebsite.com/?s1=page.

Something like this will get that affiliate id

$aff_id = $_GET['s1'];

Then you can use that variable to create a link or just redirect it to the next page

differentwebsite.com/?id=$aff_id

In PHP it would look like this

echo '<a href='http://differentwebsite.com/?id='.$aff_id.'">Link to other site</a>';

make sense?

Gabriele Petronella
  • 106,943
  • 21
  • 217
  • 235
OrganizedChaos
  • 431
  • 2
  • 11