sandari Posted September 20, 2012 Share Posted September 20, 2012 Using localhost my web page displays pefectly (i.e. header.html, index.php, footer.html) with header.html and footer.html being included files. However, in a live situation calling the web page only displays the header.html and nothing else. If I comment out the header.html I get the index.php and footer.html displaying. I have checked it in Firefox and IE. Anyone??? Quote Link to comment https://forums.phpfreaks.com/topic/268594-included-header-file-displays-but-nothing-else/ Share on other sites More sharing options...
trq Posted September 20, 2012 Share Posted September 20, 2012 Don't bother asking for help without posting relevant code. Quote Link to comment https://forums.phpfreaks.com/topic/268594-included-header-file-displays-but-nothing-else/#findComment-1379516 Share on other sites More sharing options...
Christian F. Posted September 20, 2012 Share Posted September 20, 2012 Turn on error reporting, and see what error messages you get. Quote Link to comment https://forums.phpfreaks.com/topic/268594-included-header-file-displays-but-nothing-else/#findComment-1379519 Share on other sites More sharing options...
sandari Posted September 20, 2012 Author Share Posted September 20, 2012 Sorry. Here it is. Header.html: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <?php // Start output buffering ob_start(); //Initialise a session //session_start(); ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="drug, drugs, alcohol, rehabilitation,Fraser Coast, Hervey Bay, Torquay" /> <title><?php echo $page_title;?></title> <!-- <link rel="stylesheet" type="text/css" href="./css/layout.css"> --> <link rel="stylesheet" type="text/css" href="./css/transformations.css"> <link rel="shortcut icon" href="./images/TMI.ico" type="image/x-icon"/> <!--<link rel="shortcut icon" href="./images/ClubLogo.ico" type="image/x-icon"/>--> <script language="javascript" type="text/javascript" src="./js/datetimepicker.js"></script> <script type="text/javascript" src="/jwplayer/jwplayer.js"></script> <div class="mainmenu" align="left"> <!-- Main Banner --> <table border="0" width="90%"> <tr width="100%"> <td border="1" width="100%"> <div id="header" valign="top"> <img src="./images/TMI.png" border="0" height="110px" align="left"/> <br /> <br /> </div> </td> </tr> </table> </div> <?php require_once ('./secure/transformations_mysqli_connect.php'); ?> </head> <body> index.php: <?php session_start(); $page_title='Welcome to Transformations'; if(isset($_POST['submitted'])){ $errors=array(); if(isset($_SESSION['email'])){ $email=@mysqli_real_escape_string($dbc,$_SESSION['email']); } else{ if (empty($_POST['email'])){ $errors[]="Please enter your email address."; } //End if no email entered else{ $email=@mysqli_real_escape_string($dbc,$_POST['email']); } // End if email has been entered } if(isset($_SESSION['password'])){ $password=@mysqli_real_escape_string($dbc,$_SESSION['password']); } else{ if(empty($_POST['password'])){ $errors[]="Please enter your password"; } // End no password else{ $password=@mysqli_real_escape_string($dbc,$_POST['password']); } // End password entered } if(empty($errors)){ //If there were no errors $query="select id, GivenName1, Surname, Campus, Classification from tblstaff where ((email='$email') and (password='$password'));"; $result=@mysqli_query($dbc, $query); $row=@mysqli_fetch_array($result, MYSQL_BOTH); if($row){ //If a match is found $_SESSION['ClientID'] = $row[0]; $_SESSION['GivenName1'] = $row[1]; $_SESSION['Surname'] = $row[2]; //Redirect the user to the loggedin page $url='http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']); // Check for a trailing slash if((substr($url,-1)=='/') or (substr($url,-1)=='\\')){ $url=substr(url,0,-1); //Remove the slash } //End check for trailing slash $url.='./admin.php'; header("location: $url"); exit(); } //End of if match found else{ //If no match found // include('./includes/header.html'); ?> <div class="login" align="center" valign="top" width="90%"> <h2 align="center">Login</h2> <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST"> <p class="error"> <h3 align="center"><label>Your email and/or password are not on file.</label><br /> <label>Please Register as a New User.</label></h3></p> <div class="buttons" align="center" width="25%"> <br /><br /> <form method="LINK" action="forgot_password.php"> <input type="submit" value=" Forgot Password?"> </form> <br /> <br /> <br /> <form method="LINK" action="register.php"> <input type="submit" value="Register New Client"> </form> </div> <div> <form></form> </div> </div> <!-- END OF CENTRE COLUMN --> <?php } //End if no match found } //End if no errors else{ // include('./includes/header.html'); foreach($errors as $key=>$value){ echo "<h5 align=\"center\">$value</h5>"; } echo"<h5 align=\"center\">Or Use the Button Below to <br />Register as a New Client</h5>"; ?> <h4> <div class="buttons" align="center" width="25%"> <form method="LINK" action="register.php"> <input type="submit" value=" New Client "> </form> </div> </h4> <!-- Start of Centre Column --> <div class="login" align="center" valign="top" width="90%"> <h2 align="center">Login</h2> <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST"> <fieldset> <h4 align="center"> <label>Email Address:</label><br > <input type="text" name="email" value=" " size="20" maxlength="40" border="2"/> <br /> <label>Password:</label><br /> <input type="password" name="password" value=" " size="20" maxlength="20" border="2"/></h4> <div class="buttons" align="center" width="25%"> <form method="POST" action="login.php"> <input type="submit" value=" Login "> <input type="hidden" name="submitted" value="TRUE" /> </form> <br /><br /> <form method="LINK" action="forgot_password.php"> <input type="submit" value=" Forgot Password?"> </form> <br /><!-- <form method="LINK" action="register.php"> <input type="submit" value=" Register "> </form> --> </div> </fieldset> </form> </div> <!-- End of Centre Column --> <?php } //End if there were errors } //End if(isset($_POST['submitted']) //} //End if submitted else{ //If form not submitted // include('./includes/header.html'); $_SESSION=array(); session_destroy(); $_POST=array(); $_GET=array(); ?> <!-- Start of Centre Column --> <table class="login" align="center" valign="top" width="90%"> <tr> <td> <fieldset> <h2 align="center">New Client</h2> <div class="buttons" align="center" width="25%"> <form method="LINK" action="register.php"> <strong> <input type="submit" value=" Register "> </strong> </form> </div> </h2> </fieldset> </td> </tr> <tr> <td> <fieldset> <h2 align="center">Login</h2> <form method="POST" action="login.php"> <h4 align="center"> <label>Email Address:</label><br /> <input type="text" name="email" value=" " size="50" maxlength="100" border="2"/> <br /> <label>Password:</label><br /> <input type="password" name="password" value=" " size="20" maxlength="20" border="2"/> </h4> <div class="buttons" align="center" width="25%"> <h4> <input type="submit" value=" Login "> <input type="hidden" name="submitted" value="TRUE" /> <br /><br /> </div> </form> <div class="buttons" align="center" width="25%"> <form method="LINK" action="forgot_password.php"> <input type="submit" value="Forgot Password?"> </form> </div> </h4> </fieldset> </td> </tr> </table> <!-- End of Centre Column --> <?php }// End if form not submitted include ('./includes/footer.html'); ?> footer.html: <table border="0" width="90%"> <tr border="0" width="100%"> <td border="0" width="100%"> <div class="footer" align="center"> <hr /> <?php echo '<h5 align="center"> <label>Copyright 2012 SandySoft </label><br /> ?> <hr /> </div> <!-- End of div:footer --> </td> </tr> </table> </body> </html> mod edit: code in code tags please Quote Link to comment https://forums.phpfreaks.com/topic/268594-included-header-file-displays-but-nothing-else/#findComment-1379749 Share on other sites More sharing options...
sandari Posted September 24, 2012 Author Share Posted September 24, 2012 All is OK! The problem turned out to be with my ISP who has turned off some features :-( Quote Link to comment https://forums.phpfreaks.com/topic/268594-included-header-file-displays-but-nothing-else/#findComment-1380483 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.