How do I pass forward a file or file name from a redirect page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xxxphp3
    New Member
    • Nov 2007
    • 1

    How do I pass forward a file or file name from a redirect page

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




    The above pages use an html redirect code



    Pages a, b, and c are redirect pages to mainpage.php
    How can I how can I open storya.txt when someone clicks on ~.com/a in the mainpage.php or storyb.txt if they click on ~ .com/b ?
    Last edited by Atli; Nov 12 '07, 04:36 PM. Reason: Replaced real URL's with example.
  • Lumpy
    New Member
    • Oct 2007
    • 69

    #2
    An easy way to do this would be to put a variable into the url. Redirect to something like www.domain.com/whatever?page=a and then in the first few lines of the target page, put in a few lines of php code that will load the right content.

    [CODE=php]
    <?php
    if (isset($_GET['page'])) {

    ///code to get right content

    }
    [/CODE]

    Simple and effective...goo d luck!

    Comment

    Working...