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

Link to comment
Share on other sites

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.

 

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.