Jump to content

[SOLVED] Help with existing php nav - very simple version.


Syke

Recommended Posts

Hey everyone, hoping anyone can help me. This is the code my friend gave to me.

 

This code:

<?php

$f = $_GET['pg'];

if($f == null){

$f = "home";

}

if(file_exists($f . ".php")){

include($f . ".php");

}else{

echo("File not found.");

}

?>

 

would go into the table in which i want each file to load.

 

and each link would be:

 

index.php?pg=file2 / index.php?pg=file3

 

and so on.

 

this is what im looking for, but for some reason it's not working for me.

 

can anyone simplify it and rewrite it for me?

 

Thankyou in advance.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.