Forum Moderators: coopster

Message Too Old, No Replies

php redirect w/ update by passing variable

my dream admin system for handling sponsors

         

eatapeach

8:45 pm on Jul 26, 2003 (gmt 0)

10+ Year Member



Hi,

I have a setup where I have my sponsor links from my pages going to a sponsor.php by product which I then redirect to the sponsor.

Right now, when I want to change the sponsor I'm sending traffic to I have to open Notepad and change the sponsor.php page then upload it to my server.

What I'd like to do is write an admin page that allows me to change all my sponsor pages from one page and then have that update all of my pages.

My line of thinking was to have the admin page write to a file that could be included in each sponsor.php page that could assign the sponsor url to a variable then pass it in to redirect the page.

I've seen lots of things that are similar to this but nothing that seems to work like I'm hoping. Is this even possible?

Does anyone have any ideas or a link to a tutorial that can point me in the right direction?

Thanks in advance for your help :)

Take care,
Michael

vincevincevince

10:28 pm on Jul 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Let's see if I understand you right:

Your pages have within them link to sponserX.php

sponserX.php redirects to the real url for sponserX?

If so - I suggest a redesign:

have your links as sponser.php?sponsorid=6
ie, use an argument, and always use the same sponser.php file name for all sponsers (different argument)

in the sponser.php you would have:

switch ($_REQUEST['sponsorid'])
{
case "6" : {$goto="http://*thesponsor.url"; break;}
case "7" : {$goto="http://*theothersponsor.url"; break;}
}
.... do your normal redirect code to $goto

eatapeach

11:35 pm on Jul 26, 2003 (gmt 0)

10+ Year Member



Hi VVV,

thanks for the reply.

to clarify my current setup:

on my pages i have all my links for various products each linking to one page for that product.

for instance, i have all of my links for blue widgets link to bluewidgets.php on my server, where i then use this page to redirect to the blue widget sponsor that is converting best for me at the time. if one sponsor is converting poorly i can change this one page and have all of my links directed to a new sponsor.

would the example that you gave me work for this setup?

thanks again :)

take care,
michael

vincevincevince

11:10 am on Jul 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yes, that would work, but now i realise it's just going to make it easier for you, not the full solution you want.

what it seems you really need is a database, eg mySQL - do you have access to that?

eatapeach

8:24 pm on Jul 27, 2003 (gmt 0)

10+ Year Member



"what it seems you really need is a database, eg mySQL - do you have access to that? "

yes, I have mysql available, but I'm just working on building my first database driven site, so I'm still very shaky on how to do most things.

I had thought that the db solution would be a good idea for the future, but i hadn't figured out how, so i was going to hedge my bets with a php solution.

i guess right now would be the best time to implement the db functionality, so its good that i started asking these questions before i got too far along. :)

thanks for your help.

take care,
michael

eatapeach

6:10 am on Jul 28, 2003 (gmt 0)

10+ Year Member



Just wanted to add this, since it was on my mind.

Another thing I've wanted to do but haven't tried, and thought I could do with the php page was have a small script that rotated hits thru a list of sponsors to spread the hits around and determine which sponsors are converting.

akso, a few of my sponsors have different landing pages for the same product, so it would be nice also to be able to determine which of the landing pages convert best by trying them all.

i imagine all of these things are possible, i'm just wondering if they are possible at the same time?

thanks again for your help.

take care,
michael

vincevincevince

5:18 pm on Jul 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yes, that can be done ;-) you could get mysql/php to randomly allocate the landing pages with a weighting equal to their conversions even ;)

eatapeach

12:55 am on Jul 29, 2003 (gmt 0)

10+ Year Member



fantastic :)

i'm browsing all the php/mysql messageboards and tutorial sites now, trying to learn what i need to do to make this happen.

thanks for your help.

take care,
michael