php experts, I need your help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HunkyLuke
    Virgin by request ;)
    • Feb 2002
    • 1924

    #1

    php experts, I need your help

    Hi, I need to know how to do this:

    traffic sent to this url:
    http://domain.com/index.php?10001
    will display index1.php

    traffic sent to this url:
    http://domain.com/index.php?10002
    will display index2.php

    traffic sent to all other numbers, eg, http://domain.com/index.php?20001
    will display index.php (or index3.php if index.php is not possible)

    I am sure this is totally easy to do but I need help,

    Thanks in advance,

    Luke
  • aztecvision
    Confirmed User
    • Feb 2003
    • 979

    #2
    This should work..

    if($QUERY_STRING =(remove this space)= 10001)
    {
    include($DOCUMENT_ROOT/includes/index1.php);
    }else if($QUERY_STRING =(remove this space)= 10002)
    {
    include($DOCUMENT_ROOT/includes/index2.php);
    }else{
    include($DOCUMENT_ROOT/includes/index3.php);
    }


    Add this to the inside the body tag of index.html
    Then make sure that /includes/index1.php index2.php & index3.php exist.. These 3 files should only have the body content and not any html/head/body tags what so ever..
    Last edited by aztecvision; 05-01-2003, 03:56 PM.

    Comment

    • HunkyLuke
      Virgin by request ;)
      • Feb 2002
      • 1924

      #3
      Bloody kewl!!! I love php, I wish I knew it a bit more!

      Thanks aztecvision, that was exactly what I was looking for.

      Cheers!

      Luke

      Comment

      Working...