Intro to php, breaking pages into pieces to keep all the commone elements in one place, using sessions, etc.
http://www.buffaloit.com/forum/showthread.php?t=364
http://www.buffaloit.com/forum/showthread.php?t=364
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Intro to php, breaking pages into pieces to keep all the commone elements in one place, using sessions, etc.
http://www.buffaloit.com/forum/showthread.php?t=364
Not Found
The requested URL /forum/showthread.php was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
This link doesn't work...
<?php
// This space would be a good place to add tracking information, such as logging # of
// page views, which pages got viewed, ip addresses, browser info, where they came from, etc.
// I may post some code to do this later, but for now: A page view counter!
// The Logout button is really only there as a reset on the session, just to show how it works.
session_start(); // Star the session, this gets done everytime you run the script.
// The session ends when the browser is closed.
if (isset($_SESSION['views'])){
$_SESSION['views']++;
}
else {
$_SESSION['views']=1; // Creates a session variable, it is retained as long as the session is active.
}
if ($_GET['action']=="logout") { // Check for the logout being pushed
$_SESSION = array(); // Destroy any session Variables
session_destroy(); // Destroy the session
header("Location: index.php"); // Redirect back to self
// This CANNOT be done after anything else has been sent to the browser.
exit(); // exit the script
}
require_once('head.inc'); // Links in the header info for the page
// in the head viewer is a added section to show how many pages have been viewed this session.
// This changes the content of the body based on the "action" variable.
// index.php?action=page1 sets the variable to "page1", this passes the variable through "GET"
// These files are written in plain html.
if ($_GET['action']=="page1") {
require_once('page1.inc');
}
else if ($_GET['action']=="page2") {
require_once('page2.inc');
}
else { // if nothing is passed, or something that isn't listed above display the main page.
require_once('page0.inc');
}
// Display the footer info and close everything off.
require_once('foot.inc');
?>
<!DOCTYPE XHTML PUBLIC '-//W3C//DTD XHTML 1.0//EN' '[URL="http://www.w3.org/TR/xhtml1/xhtml1-strict.dtd%27%3E"]http://www.w3.org/TR/xhtml1/xhtml1-strict.dtd'>[/URL]
<html>
<head>
<title>Simple PHP Enhancements</title>
</head>
<body>
You have viewed <?php echo $_SESSION['views'] ?> pages!
<table border ='1' style='width:100%'>
<tr>
<th style='font-size:200%;'>Simple PHP Enhancements Demo</th>
</tr>
<tr>
<td style='text-align:center'>
<a href="index.php">Main</a>
<a href="index.php?action=page1">Page 1</a>
<a href="index.php?action=page2">Page 2</a>
<a href="index.php?action=logout">Log Out</a>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td style='text-align:center'>Footer info</td>
</tr>
</table>
</body>
</html>
<h3>Main Page</h3>
<p>
Text goes here. Text goes here. Text goes here. Text goes here. Text goes here.
Text goes here. Text goes here. Text goes here. Text goes here. Text goes here.
Text goes here. Text goes here. Text goes here. Text goes here. Text goes here.
Text goes here. Text goes here. Text goes here. Text goes here. Text goes here.
Text goes here. Text goes here. Text goes here. Text goes here. Text goes here.
Text goes here. Text goes here. Text goes here. Text goes here. Text goes here.
</p>
<h3>Page 1</h3>
<p>
Text goes here. Text goes here. Text goes here. Text goes here. Text goes here.
Text goes here. Text goes here. Text goes here. Text goes here. Text goes here.
Text goes here. Text goes here. Text goes here. Text goes here. Text goes here.
Text goes here. Text goes here. Text goes here. Text goes here. Text goes here.
Text goes here. Text goes here. Text goes here. Text goes here. Text goes here.
Text goes here. Text goes here. Text goes here. Text goes here. Text goes here.
</p>
<h3>Page 2</h3>
<p>
Text goes here. Text goes here. Text goes here. Text goes here. Text goes here.
Text goes here. Text goes here. Text goes here. Text goes here. Text goes here.
Text goes here. Text goes here. Text goes here. Text goes here. Text goes here.
Text goes here. Text goes here. Text goes here. Text goes here. Text goes here.
Text goes here. Text goes here. Text goes here. Text goes here. Text goes here.
Text goes here. Text goes here. Text goes here. Text goes here. Text goes here.
</p>