Log in

View Full Version : pages that change content links depending on user id?



eternalluster
04-26-2009, 07:14 PM
Hi everyone,

I have pages created with links to different services, websites and the like, and when you click on them, they go to these sites with my username or id for referrals.

I am trying to figure out how to create these pages so that when my users advertise these same pages, the links inside automatically change to their information they would enter in their members section on my website, so that I do not get all their referrals to the linked sites. If this makes any sense.. I'm not so sure how to describe it.

Like, if you go to http://trafficexchangeprofits.net/trafficreport.php?id=tryingtohelp

and look at the links, they are mine ... then you go to

http://trafficexchangeprofits.net/trafficreport.php?id=moneyrev

the page is identical but the links to the programs changes depending on the username or id information we entered in a form for the sites on the te website.

This is what I would like to do with my site so that people wanting to advertise my pages, get credit for it and not me, if that makes better sense? but am not sure where to start.

Any help would be so very greatly appreciated. Thank you so much for your valuable time :)

eternalluster
04-26-2009, 08:44 PM
I know the script isn't in the page itself, but rather, in the site, it would look something like this I think, but I am DEFINITELY no programer.. don't know what to do with it if it IS right :confused:


<form method='post' action='UBGscript.php/?page=pageidgoeshere'>
<div align='center'>

<table cellSpacing='0' cellPadding='0' bgColor='#ffffff' border='0' bordercolor='#ffffff'>
<table align='center' width='100%' border='1'>
<tr>
<td vAlign='middle' align='center' width='90%'>
<font face='Trebuchet MS' size='2'>Enter Your TrafficWave
<b>username ONLY</b></font></td>

<td align='left' width='10%'>
<font face='Trebuchet MS' size='2'>
<input class='TextBox' size='40' name='Mar4' value='eternalluster'></font>
</td>
</tr>

<tr align='middle'>
<td align='center' colSpan='2'><font face='Trebuchet MS' size='1'>
<input class='Button' type='submit' value='Edit Details' name='Submit'>

</font></td>
</form>

X96 Web Design
04-27-2009, 01:48 AM
Take out the slash:

<form method='post' action='UBGscript.php?page=pageidgoeshere'>

Hope this helps (and works!)

// X96 \\

eternalluster
04-27-2009, 07:42 PM
Hi all, I am hoping someone here can help as I have been trying to figure this out for months!

I need a script that: when a member fills in a form field with their referral id to the program listed and hits submit, the script updates the webpage they are advertising with their referral id's.

It is the same exact page for everyone, but when they use this form it updates their version with their own id's. The only thing that changes is the url to the page as the end includes their user id for our site so the script knows who's link information goes on the page.

Hope that makes better sense? Thank you so very very much to anyone that can help, this has been driving me insane :cry:

bkatzung
04-29-2009, 02:04 PM
I'm not sure, but I think what you're looking for is something like...



<?php
$link_table = array(
'tryingtohelp' => array(
'site1' => 'http://some.where/script/id1234',
'site2' => 'http://other.place/whatever?ref=tryingtohelp'
),
'moneyrev' => array(
'site1' => 'http://some.where/script/id5678',
'site2' => 'http://other.place/whatever?ref=moneyrev'
)
);

$id = $_REQUEST['id'];

echo <<<HTML
<html><body>
<!-- Some HTML goes here -->
Wonderful stuff <a href='{$link_table[$id]['site1']}'>here</a>.
And more wonderful stuff <a href='{$link_table[$id]['site2']}'>here</a>.
<!-- More HTML goes here -->
</body></html>

HTML;

# END


Now when you visit

this_script.php?id=tryingtohelp

you get one set of links, and when you visit

this_script.php?id=moneyrev

you get a different set of links.

Obviously, a lot more can be done to improve this script, but is that generally what you had in mind?