Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17
  1. #11
    Join Date
    Nov 2006
    Location
    Liverpool/Manchester
    Posts
    2,457
    Tokens
    0

    Latest Awards:

    Default

    Thanks I'll try that out tomorrow +rep

    edit: will that code just work with php pages?
    Last edited by iJoe; 06-09-2008 at 10:21 PM.
    Joe


  2. #12
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    Yeah it will, I will modify the code a bit so it can do html as well.

    PHP Code:
    <?php 
    $p 
    addslashes$_GET['page'] ); 
         if( isset ( 
    $p ) ) {
              if ( isset ( 
    $_GET['html'] ) ) {
                  
    $p "/content/" $p ".html"
              }
              else {
                  
    $p "/content/" $p ".php";
              }
              if( 
    file_exists $p ) { 
                   include( 
    $p ); 
              } 
                   else { 
                        include( 
    "404.php" ); //Page that is displayed if the file doesnt exist
                   

         } 
         else { 
              
    $p "/content/indexpage.php"//Put the URL to your old homepage that was in the iframe here
              
    include( $p ); 
         } 
    ?>
    If a page is .php you do yoursite.com/index.php?page=games and it will include yoursite.com/content/games.php. If its a HTML page you want to include you do yoursite.com/index.php?page=games&html= and it would include yoursite.com/content/games.html.

    So all links around your site would need to be done like <a href="http://yoursite.com/index.php?page=a"></a>.
    Lets set the stage on fire, and hollywood will be jealous.

  3. #13
    Join Date
    Nov 2006
    Location
    Liverpool/Manchester
    Posts
    2,457
    Tokens
    0

    Latest Awards:

    Default

    Getting an error for some reason :S

    Parse error: syntax error, unexpected '{' in /home/nexdana/public_html/v3/erm.php on line 10
    Using your code above
    Joe


  4. #14
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    <?php 
    $p 
    addslashes$_GET['page'] ); 
         if( isset ( 
    $p ) ) {
              if ( isset ( 
    $_GET['html'] ) ) {
                  
    $p "/content/" $p ".html"
              }
              else {
                  
    $p "/content/" $p ".php";
              }
              if( 
    file_exists $p ) ) { 
                   include( 
    $p ); 
              } 
                   else { 
                        include( 
    "404.php" ); //Page that is displayed if the file doesnt exist
                   

         } 
         else { 
              
    $p "/content/indexpage.php"//Put the URL to your old homepage that was in the iframe here
              
    include( $p ); 
         } 
    ?>
    Lets set the stage on fire, and hollywood will be jealous.

  5. #15
    Join Date
    Nov 2006
    Location
    Liverpool/Manchester
    Posts
    2,457
    Tokens
    0

    Latest Awards:

    Default

    Hmm, now it is saying no pages exist http://www.nexdana.com/v3/erm.php

    PHP Code:
    <?php 
    $p 
    addslashes$_GET['page'] ); 
         if( isset ( 
    $p ) ) {
              if ( isset ( 
    $_GET['html'] ) ) {
                  
    $p "http://www.nexdana.com/v3/" $p ".html"
              }
              else {
                  
    $p "http://www.nexdana.com/v3/" $p ".php";
              }
              if( 
    file_exists $p ) ) { 
                   include( 
    $p ); 
              } 
             else { 
                        include( 
    "404.php" ); //Page that is displayed if the file doesnt exist
                   
    }       
         } 
         else { 
              
    $p "http://www.nexdana.com/v3/home.html"//Put the URL to your old homepage that was in the iframe here
              
    include( $p ); 
         } 
    ?>
    I can't see whats wrong :S
    Joe


  6. #16
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    <?php  
    $p 
    addslashes$_GET['page'] );  
         if( 
    $p != "" ) { 
              if ( isset ( 
    $_GET['html'] ) ) { 
                  
    $p "http://www.nexdana.com/v3/" $p ".html";  
              } 
              else { 
                  
    $p "http://www.nexdana.com/v3/" $p ".php"
              } 
              if( 
    file_exists $p ) ) {  
                   include( 
    $p );  
              }  
             else {  
                        include( 
    "404.php" ); //Page that is displayed if the file doesnt exist 
                   
    }        
         }  
         else {  
              
    $p "http://www.nexdana.com/v3/home.html"//Put the URL to your old homepage that was in the iframe here 
              
    include( $p );  
         }  
    ?>
    Sorry I was tired yesterday when I wrote this.
    Lets set the stage on fire, and hollywood will be jealous.

  7. #17
    Join Date
    Nov 2006
    Location
    Liverpool/Manchester
    Posts
    2,457
    Tokens
    0

    Latest Awards:

    Default

    I think it might be me now, still not working :S

    Am I right in thinking that http://www.nexdana.com/v3/contact.php should show if I use the url http://www.nexdana.com/v3/erm.php?page=contact ?

    It's still saying the pages don't exist

    Thanks for your patience by the way
    Joe


Page 2 of 2 FirstFirst 12

Posting Permissions

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