I am not sure if this issue is 'standard' or part of the debugger, or self inflicted but here goes:
My site is organized so that the navigation menus will reference a folder on the web server. Inside the folder I have, basically, 2 files: an 'index.php' and also a 'form.html.php'. The 'index.php' file will run first and it will decide what data to get and populate on the 'form.html.php' page.
This all works very nicely and cleanly. BUT... after the 'form.html.php' finishes loading and is displayed in the browser, the 'index.php' file is accessed again, but this time it does not appear to cause the page to reload even though the debugger shows it as processing the last request all over again.
in essence, the process is like this (as seen in debugger):
1. index.php is loaded
2. index.php processes and loads form.html.php
3. form.html.php processes and is displayed to the user
4. index.php is again reloaded
5. form.html.php does NOT appear to be reloaded.
This is true for all pages, even ones with very basic html.
Does this make any sense? All of my development is for corporate internal use and not available on the interweb.
I am hoping that this is a self inflicted annoyance and that there is something I can do to stop it. It is more annoying than anything else as it does not seem to affect how the system works.
Thank you all in advance for helping a novice out. I am trying to learn on my own and getting better... but have a long ways to go.
Here is a basic index.php:
<?php
session_start();
// do includes
if(isset($_SESSION['userLoggedIn']) && $_SESSION['userLoggedIn'] )
{
include_once $_SERVER['DOCUMENT_ROOT'] .
'/truck/inc/magicquotes.inc.php';
include_once $_SERVER['DOCUMENT_ROOT'] .
'/truck/inc/base.inc.php';
include_once $_SERVER['DOCUMENT_ROOT'] .
'/truck/inc/standardFunctions.inc.php';
checkAdmin();
// end includes, do index variable definition and initial allocations
$formTitle = 'Transportation Main';
$formHeading = 'Welcome '.$_SESSION['username'].' to the Transportation System';
if(isset($_POST['action']) && $_POST['action']=='submitted')
{
// form has been submitted and action needs to be taken
}
include ('form.html.php');
exit();
}
else
{
header('Location: http://'.$_SERVER['HTTP_HOST'].'/truck/user/');
exit();
}
?>
|
here is a basic form.html.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<link rel="stylesheet" type="text/css" href="<?php print 'http://'.$_SERVER['HTTP_HOST'].'/truck/css/my3.css';?>">
<?php include $_SERVER['DOCUMENT_ROOT'] .'/truck//inc/favicon.php'; ?>
<head>
<meta charset="utf-8">
<title><?php print $formTitle; ?></title>
</head>
<body>
<div id="head" align="center">
<?php include $_SERVER['DOCUMENT_ROOT'] .'/truck/header/header.html.php'; ?>
</div>
<?php printPageLayout(0); ?>
<div id="content">
<form action="" method="post">
<?php
if($_SESSION['accessLevel']==3) include ($_SERVER['DOCUMENT_ROOT'] .'/truck/user/admin.html.php');
print '<h1><center>'.$formHeading.'</center></h1>';
?>
</form>
<div align="center"><img src="<?php print 'http://'.$_SERVER['HTTP_HOST'].'/truck/images/';?>welcome.gif" width="702" height="395" />
</div>
</body>
</html>
|
[/code]