Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jul 2002
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer how to do PHP pages

    i was wondering..does anyone know how exactly to get pages to come up with like "http://www.server.com/pages.php?id=hosting ? what are the exact steps in making that able to happen? i know u gotta make like hosting.php so when its called like that it works..but i need the exact steps

  • #2
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Link to it like that, and use the variable $id and an if-then-else statement to display different things with different ids.
    PHP Code:
    example:

    if (
    $id == hosting){ echo "InsertStuffHere"
    }
    else if (
    $id == quack){ echo "MrQuakers was here"

    Last edited by MrNonchalant; 08-12-2002 at 04:38 AM.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    577
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you want id=hosting to reference hosting.php and build the main page to include that subfile...

    PHP Code:
    if($_POST) {extract($_POST);}
    $basepath '/usr/home/dommy/includes/';
    if(!isset(
    $id) || $id=="") {$id 'default';}

    if(
    file_exists($basepath.$id.'.php')) {
    include(
    $basepath.$id.'.php');
    }

    else {
    echo 
    'Requested page could not be found';

    Which basically tests whether the variable $id exists (if it doesn't, the script assigns it a value of 'default'), tests whether a file exists in the dictated folder with the name $idvalue.php and if that file exists it includes it in the main page.
    That system is most useful for templates where the head, title and main page look are static.
    Ökii - formerly pootergeist
    teckis - take your time and it'll save you time.

  • #4
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Shetland Isles, UK
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Have a look on alistapart as they've put up an article recently which may give you some pointers to the what you're trying to do.

    --
    r/f/g

  • #5
    New Coder
    Join Date
    Jul 2002
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok thanks for the help guys!


  •  

    Posting Permissions

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