Menu
Hi there. I’m now on a new mission!
My Server supports PHP, and I have created a theme (which I haven’t made “active yet”) – and I have created all my content files, with the html content (no <html> etc tags…we’ll get to that ?) and put them as .php files.
How “easy” would it be to call them from index.php, and it gets it’s “theme” from there? i.e. index.php?p=forum would load forum.php.
In the .php content files, I realise I have to “open” the theme, so the content gets placed within, but how easy is it to achieve this type of thing?
Many thanks!
[code=php]
<?php
if(isset($_GET["p"])){
$p = $_GET["p"];
header("Location: $p");
}
?>
[/code]
[code=php]
<?php
include("headers.php");
?>
[/code]
[code=php]
<?php
include("footers.php");
?>
[/code]
[code=php]
<?php
include("headers.php");
?>
This is the text. It is inside of a DIV.
<?php
include("footers.php");
?>
[/code]
[code=php]
<?php
if (!eregi("page.php", $_SERVER['PHP_SELF'])) {
die ("You can't access this file directly...");
}
if (!isset($mainfile)) { include("page.php"); }
$index = 0;
include("header.php");
?>
<div align="justify">
All the rest of the HTML content.
</div>
<?php
include("footer.php");
?>
[/code]
[code=php]
<?php
if(isset($_GET["p"])){
$p = $_GET["p"];
header("Location: $p");
}
else {
die ("Sorry, you can't access this file directly...");
}
?>
[/code]
[code=php]
if(file_exists("dir/file.ext")){
echo("File exists.");
} else {
echo("File does not exist.");
}
[/code]
[i]Originally posted by skydan [/i]
[B]Yay - that manual is good! [/B][/QUOTE]
[code=php]
<?php
if($_GET["p"] == "staff"){
$firstHeading = "Staff Members:";
}
if(isset($_GET["id"])){
$staff_id = $_GET["id"];
}
$staff_Ary = array("first staff member's name (id=0)", "second staff member's name (id=1)"); # add as many as you want
$staff_details = array("Information to be posted for the first staff member (id=0)", "Information to be posted for the second staff member (id=1)", "Information to be posted for the third staff member (id=2)"); # arrays start at zero rather than one
echo("<h1>". $firstHeading ."</h1>");
echo("<h2>". $staff_Ary[$staff_id] ."</h2>");
echo("<p>". $staff_details[$staff_id] ."</p>");
?>
[/code]
[code=php]
Your IP address is: <?php ... ?><br>
Your browser is: <?php ... ?><br>
[/code]
[code=php]
<?php
echo($_SERVER["REMOTE_ADDR"]); # ip address
echo("<br>". $_SERVER["HTTP_USER_AGENT"]);
?>
[/code]
[code=php]
<?php
echo("<b>Your IP:</b>". $_SERVER["REMOTE_ADDR"]); # ip address
echo("<br><b>Your browser:</b>". $_SERVER["HTTP_USER_AGENT"]);
?>
[/code]
[code=php]Your IP address is: <?php echo $_SERVER['REMOTE_ADDR']; ?><br>
Your browser is: <?php $_SERVER['HTTP_USER_AGENT']; ?><br>[/code]
0.1.9 — BETA 5.18