Results 1 to 7 of 7

Thread: php include

  1. #1
    Join Date
    Aug 2005
    Posts
    174
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default php include

    Hi,

    I want to change the php include when someone clicks on a link on the page. Does anyone know if this is possible?

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Of course it is. Make the link pass a GET variable, then check for that variable when you call the include.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Aug 2005
    Posts
    174
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Hi Twey, Thanks for your help once again!!

    How would i go about doing this?
    So for, all I have is:

    <?php include("http://www.mysite.com/iframe.asp?hs=xxxx"); ?>

    What would i have to do to the link to change the url in that php include??

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Say the page that includes that is called page.php.
    PHP Code:
    <?php if($_GET['inc'] == "zzzz") include("http://www.mysite.com/iframe.asp?hs=xxxx");
    else include(
    "http://www.mysite.com/iframe2.asp?hs=yyyy"); ?>
    Then, if the page was accessed as page.php?inc=zzzz it would include iframe.asp?hs=xxxx; otherwise, it would include iframe2.asp?hs=yyyy.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Aug 2005
    Posts
    174
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    thank you!! works fantasticly

  6. #6
    Join Date
    Aug 2005
    Posts
    174
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    OK, so now what i've done is:

    On the page handset.php, the value of the parametre "network" changes the "php include". Could you add another parametre called "tracking" to change another part of the url in the "php include" ??

    But i want the tracking parametre to work whatever the network parametre is...

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    PHP Code:
    <?php if($_GET['network'] == "zzzz") include("http://www.mysite.com/iframe.asp?hs=xxxx");
    else include(
    "http://www.mysite.com/iframe2.asp?hs=" . ($_GET['tracker'] == 'wwww' 'vvvv' 'yyyy')); ?>
    Goes to iframe2.asp?hs=vvvv if tracker is wwww; otherwise, goes to iframe2.asp?hs=yyyy.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •