ThanksI'll try that out tomorrow +rep
edit: will that code just work with php pages?

ThanksI'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
Yeah it will, I will modify the code a bit so it can do html as well.
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.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 );
}
?>
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.
Getting an error for some reason :S
Using your code aboveParse error: syntax error, unexpected '{' in /home/nexdana/public_html/v3/erm.php on line 10
Joe
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.
Hmm, now it is saying no pages existhttp://www.nexdana.com/v3/erm.php
I can't see whats wrong :SPHP 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 );
}
?>
Joe
SorryPHP 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 );
}
?>I was tired yesterday when I wrote this.
Lets set the stage on fire, and hollywood will be jealous.
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
Want to hide these adverts? Register an account for free!