Jump to content

Pass info forward from a redirect page


xxxphp3

Recommended Posts

I have a main page with 75% constant contents. I want to change the other 25% depending on what page calls the main page.

Example

www.mysie.com/a.html

www.mysite.com/b.html

www.mysite.com/c.html

 

www.mysite/x/y/z/mainpage.php

 

Pages a, b, and c are redirect pages to mainpage.php

How can I how can I open storya.txt in the mainpage.php when someone clicks on ~.com/a or storyb.txt if they click on ~ .com/b ?

 

 

Link to comment
https://forums.phpfreaks.com/topic/76823-pass-info-forward-from-a-redirect-page/
Share on other sites

Hidden inputs can be tampered with just as easily or even easier than the referer. The only real safe option would be to use session, but I'm not sure it warrants it for such a simple task.

 

I wasn't referring to changing the inputs, I was referring to how unreliable HTTP_REFERER is. Firewalls, Spyware blockers, Virus scanners, Browsers, Browser extensions, and other client side factors that number in the hundreds could make this variable fail.

Why not just store the different content in a mysql table and call it out by an id.

 

www.mysie.com?a=1

www.mysite.com?b=2

www.mysite.com?c=3

 

Then us $_GET[a] to retrieve the id.

 

Run your query with that id to pull the information from the database for that mainpage.

 

Then just echo it out in the appropriate info its location on the page.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.