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 2 of 2
  1. #1
    New Coder
    Join Date
    Nov 2002
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts

    dynamic includes

    Does anyone know of any tutorials that are similar to this one: http://www.hotscripts.com/Detailed/21358.html (the link to the actual tutorial doesnt work)
    I tried searching but with no success. Thanks for any help.
    -Nick

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
    $pages = array();
    $pages['start'] = 'a.php';
    $pages['contact'] = 'b.php';
    $pages['error'] = 'error.php';

    if (isset(
    $_GET['page']) && isset($pages[$_GET['page'])) {
    require_once 
    $pages[$_GET['page'];
    } else {
    require_once 
    $pages['error'];

    Call it like domain.tld/page=contact and there you go.
    De gustibus non est disputandum.


  •  

    Posting Permissions

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