Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2006
    Location
    West Midlands
    Posts
    463
    Tokens
    2,175

    Latest Awards:

    Default Includes? or something...

    I ain't done web design for age, so I've basically forgot most things or just got little bit's of information.

    Right ages ago around about Jan/Feb I think Invent! owned a webdev website or something, I requested something to do with PHP includes so that when I clicked a link it opened in a content box or whatever.

    I was hoping someone could help me with this by posting the PHP.
    Thanks, and plus rep.

  2. #2
    Join Date
    Oct 2006
    Location
    West Midlands
    Posts
    463
    Tokens
    2,175

    Latest Awards:

    Default

    Oh and I forgot to mention, in the nagiation your link would be like index.php?p=home.php or something like that... if that helps? :S
    Always lurking around, never really post.

  3. #3
    Join Date
    Oct 2006
    Location
    West Midlands
    Posts
    463
    Tokens
    2,175

    Latest Awards:

    Default

    Umm... Bump maybe?
    Always lurking around, never really post.

  4. #4
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    Hi,

    If you want to have a script that parses the url '?page=about' and loads the file about.php in a content area then use a piece of code like this:

    PHP Code:
    <?php

    $page 
    $_GET'page' ];

    $clean = array( '/''.'':' );

    if( isset( 
    $page ) && $page != '' )
    {

        if( 
    file_exists'./' $page '.php' ) )
        {
        
            include 
    './' $page '.php';
        
        }
        else
        {
        
            include 
    '404.php';
        
        }

    }
    else
    {

        include 
    'home.php';

    }

    ?>

Posting Permissions

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