Jump to content


Photo

page.php for geno


  • Please log in to reply
1 reply to this topic

#1 Detail

Detail

    King Detail

  • Hosted
  • 7,767 posts
  • Location:Dayonic
  • Projects:Dayvi.com
  •  Blu Spy

Posted 15 August 2003 - 12:55 AM

The page.php attached is stright from the main site so it's full of crap. This is the code you need:
<?php
if($file) {
	$include = "home/content/$file.inc";
	if(!file_exists("$include")) {
  $errorfile = "$include";
  $include = "home/content/notfound.inc";
	}
	$contentname = "$include";
	$contentread = @fopen($contentname, "r");
	$content = fread($contentread, filesize($contentname));
} elseif ($script) {
	$include = "php/$script.php";
	if(!file_exists("$include")) {
  $errorfile = "$include";
  $include = "home/content/notfound.inc";
	}
	include("$include");
} else {
	$file = "main";
	$include = "home/content/$file.inc";
	$contentname = "$include";
	$contentread = @fopen($contentname, "r");
	$content = fread($contentread, filesize($contentname));
}
?>
Put that at the top of you're page.php file.

Now got there you want the info to be displayed and put:
<?php echo $content; ?>

Please don't be a nub and name this new file page.html -_-
It's php so name the file page.php.



how it works:

make a new folder called "home, in that make another folder called "content" in it make 2 empty text files called "main.inc" and "notfound.inc".
When you load page.php it will open main.inc and display what ever is in you're main.inc file. Give this a try before reading anymore.


adding pages:

make a new screenshots.inc file. now goto "page.php?file=screenshots" and the content of the screenshots.inc file will be displayed.



This is a complex code so you will be confused.
There is a realy easy way which is juts 1 line, but you asked for the page.php file :uh:

Attached Files



#2 genobreaker

genobreaker

    Infantry General

  • Hosted
  • 1,223 posts
  • Location:Philippines
  • Projects:Yuri's Revenge: Zero Hour
  •  Revorian Loyalist - 10th

Posted 15 August 2003 - 07:15 AM

thanks Detail
Become the Ultimate General - Mod Demo is Available!
Posted Image
Prepare your weapons technology against the worlds most powerful generals.
FREEDOM STUDIOS: http://www.freedomstudios.net




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users