473,748 Members | 2,575 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

page loads but only header is displayed and rest of the content is blank

107 New Member
i have the following code which is generated from a .dwt template. My problem is that the page loads but only the header part displays and rest of the contents are not displayed. Everything works fine in my local testing server but when i upload it the hosting server the problem surfaces. I am not sure why? Please kindly go through my code below:

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <!-- InstanceBegin template="/Templates/generaltemplate.dwt.php" codeOutsideHTMLIsLocked="false" -->
  4. <head>
  5. <!-- InstanceBeginEditable name="doctitle" -->
  6. <title>Title of my site</title>
  7. <!-- InstanceEndEditable -->
  8. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  9. <!-- InstanceBeginEditable name="head" -->
  10. <!-- InstanceEndEditable -->
  11. <link href="css/global.css" rel="stylesheet" type="text/css" />
  12. </head>
  13. <?php
  14. include("include/header.inc");
  15. include("include/session.php");
  16. ?>
  17. <body>
  18. <div id="nav">
  19.   <div id="navigation"> 
  20.     <a href="1.php">Link1</a> <span id="arrow">||</span> 
  21.    <a href="2.php">Link2</a><span id="arrow"> || </span>
  22.    continues…………    
  23.   </div>
  24.  <br>
  25. </div>    
  26. <table width="100%" cellpadding="0" cellspacing="0" border="0">
  27.  <tr>
  28.    <td width="17%" valign="top">
  29.      <table class="tbl" cellspacing="0" cellpadding="0" border="0">
  30.              <tr class="mnutitle">
  31.                <td style="padding-left: 12px" colspan="3">MENU</td>
  32.              </tr>
  33.              <tr>
  34.                <td style="width: 12px"></td>
  35.                <td width="151" class="menu">
  36.                  <a title="Home Page" href="home.php">Home</a></td>
  37.                <td style="width: 9px"></td>
  38.              </tr>
  39.              <tr>
  40.                <td></td>
  41.                <td class="menu">
  42.                  <a title="Menu1" href="menu1.php">Menu1</a></td>
  43.                <td></td>
  44.              </tr>
  45.              <tr>
  46.                <td></td>
  47.                <td class="menu">
  48.                  <a title="Menu2" href="menu2.php">Menu2</a></td>
  49.                <td></td>
  50.     </tr>
  51.            continues.............
  52.          </table>
  53.            <br>
  54.             <br>
  55.             <table>
  56.                 </td>
  57.    <td width="83%" valign="top" class="contents">
  58.      <!-- InstanceBeginEditable name="content" -->
  59.     ( My PHP lines) ……
  60.      <!-- InstanceEndEditable -->      
  61.    </td>
  62.   </tr>
  63. </table>
  64. <br>
  65. <br>
  66. <?php
  67. include("include/footer.inc");
  68. ?>
  69. </body>
  70. <!-- InstanceEnd -->
  71. </html>
  72.  
  73.  
Here please note that if i remove the
include("includ e/session.php");
part it works but since the session file is required in every pages i cannot avoid it. I find nothing wrong in session file with makes the script to suspend from executing. Please advice me.
Sep 16 '09 #1
13 2970
Dormilich
8,658 Recognized Expert Moderator Expert
sessions have to be initialized, before any output is sent to the browser.
Sep 16 '09 #2
raamay
107 New Member
@Dormilich
Yes you are right and the session has already been initialized in the session class itself . I include the session class and then declare global variable $session in every page before using the class. Thus, i feel there should not be any problem.
Sep 16 '09 #3
Dormilich
8,658 Recognized Expert Moderator Expert
in the code you have given, the session code is on line 15, where 12 lines of HTML output have been already sent.
Sep 16 '09 #4
raamay
107 New Member
@Dormilich
ok i get you, and it would be wise to use include("includ e/session.php"); on top of the page instead of placing in between. I did that but it doesnt solve the problem. when i do that the whole page becomes empty (the header is also gone).
Sep 16 '09 #5
Dormilich
8,658 Recognized Expert Moderator Expert
that looks like an error in the session.php file.
Sep 16 '09 #6
raamay
107 New Member
@Dormilich
But why php do not show an error? At times the static contents gets displayed while the dynamic ones are lost. This is quite disgusting. i cant figure out what the problem is.
Sep 16 '09 #7
Dormilich
8,658 Recognized Expert Moderator Expert
@raamay
without any code I can’t either.
Sep 16 '09 #8
TheServant
1,168 Recognized Expert Top Contributor
You CANNOT start sessions if any output has been done. If you can't move your <?php include('includ e/session.php'); ?> to the top of the document, then remove your session start from session.php and put it at the top. Like:

Expand|Select|Wrap|Line Numbers
  1. <?php session_start(); ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 ... 
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
  4. <!-- InstanceBeginEditable name="head" --> 
  5. <!-- InstanceEndEditable --> 
  6. <link href="css/global.css" rel="stylesheet" type="text/css" /> 
  7. </head> 
  8. <?php 
  9. include("include/header.inc"); 
  10. include("include/session.php"); 
  11. ?> 
  12. <body> 
  13.  
Also, if you are getting errors, please include those in your post. Most errors are descriptive enough, but those which are not, have usually been experienced before and the Bytes team may be able to recognise them and thus provide solutions to that exact problem. It's simpler to read errors that a page of code ;)
Sep 16 '09 #9
raamay
107 New Member
sorry to bother you again, as said earlier if i include the session file it does not work. well i will have used the same session file that is found here. The session file aswell as other file here works fine cause previously my site had the same files used. recently i got rid of my old files and replaced it will new updates, then there surfaced the problem.
Sep 17 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

6
2530
by: Matt | last post by:
I was wondering if someone could explain why I'm receiving this error. It's like a 404 error but I think it might be something else. Basically, I have a page where a user inputs his email address. The system is supposed to look up the email address and send the associated password to that email address. It worked up until a few months ago. Note that the validation works. So, if the user tries to submit a blank text box, it returns...
1
1534
by: Francois Gagnon | last post by:
Hi, I have the following scenario. THe side is built using 2 frames. The top frame is a menu where the bottom one is the content. The top frame allows th user to select what document he wants to see, the it is displayed in the bottom frame. When the user selects a report in the top frame, a form is submitted with its target as the bottom frame (and I don't use GET but POST instead). The server receiving the post reply with the...
6
1375
by: Mitch | last post by:
I'm trying to use page inheritance so that I can derive all web pages from a template. There are a bunch of examples at this site http://authors.aspalliance.com/PaulWilson/Articles/?id=1, but strangely enough, not a single one works with my design. My format is quite simple: large table direcly under the <HTML> tag contains a header usercontrol, a left side menu usercontrol and then page content. Here is a simplified representation of...
4
1768
by: Adrijan Josic | last post by:
I have this idea, I need to know if it is possible and how. Let's say you have a content managed site with all its structure and content - everything in a relational database And a "blank" page that loads content from the database. This one single page would have to know what content is requested. Obviously this could be done by pageIDs in querystring and whatnot but this is not what I'd like Here's what I need The "blank" page lies...
6
4896
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
11
2324
by: frizzle | last post by:
Hi there, I need a function to prevent a page from being loaded too often too fast. So say, one is only allowed to refresh a single page 5 times in 10 seconds, or 10 times in 5 seconds (or whatever ... ). If the load frequency exceeds that, the site calls exit(); And a message is displayed. Just like Expression Engine does ... This way i want to protect the DB from being queried rediculously
11
5075
by: ra294 | last post by:
I am building a page that needs to recieve some parametes and return blank page (empty response). After I recieve the parametes I write: Response.clear Response.End When I run the page I still get some html when doing "view source" in IE: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD>
6
1800
by: lokeanwolf | last post by:
Hi. I'm trying to create a basic template for a page, so that I can have the headers and footers stay the same, and only change the center content. I've already figured out how to do the includes part, but that requires I do that on every page on the site I am making. Is there a way I can have a single index page, which loads different content into the center depending on what link is clicked, rather than clicking a link taking it to a...
0
1584
by: bergenpeak | last post by:
I've got loads of existing web pages (vanilla html, html + frames, etc) and 100s of non html files (just raw text). I'd like to wrap these pages with the classic navigation format and info. Logically, there would be three "panes" of info in the browser-- the header info, the left nvigation info and then the "content" portion of the window where all web page changes are displayed. I've defined the css for the top navigation page, the...
0
9562
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9386
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.