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: -
<!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">
-
<!-- InstanceBegin template="/Templates/generaltemplate.dwt.php" codeOutsideHTMLIsLocked="false" -->
-
<head>
-
<!-- InstanceBeginEditable name="doctitle" -->
-
<title>Title of my site</title>
-
<!-- InstanceEndEditable -->
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-
<!-- InstanceBeginEditable name="head" -->
-
<!-- InstanceEndEditable -->
-
<link href="css/global.css" rel="stylesheet" type="text/css" />
-
</head>
-
<?php
-
include("include/header.inc");
-
include("include/session.php");
-
?>
-
<body>
-
<div id="nav">
-
<div id="navigation">
-
<a href="1.php">Link1</a> <span id="arrow">||</span>
-
<a href="2.php">Link2</a><span id="arrow"> || </span>
-
continues…………
-
</div>
-
<br>
-
</div>
-
<table width="100%" cellpadding="0" cellspacing="0" border="0">
-
<tr>
-
<td width="17%" valign="top">
-
<table class="tbl" cellspacing="0" cellpadding="0" border="0">
-
<tr class="mnutitle">
-
<td style="padding-left: 12px" colspan="3">MENU</td>
-
</tr>
-
<tr>
-
<td style="width: 12px"></td>
-
<td width="151" class="menu">
-
<a title="Home Page" href="home.php">Home</a></td>
-
<td style="width: 9px"></td>
-
</tr>
-
<tr>
-
<td></td>
-
<td class="menu">
-
<a title="Menu1" href="menu1.php">Menu1</a></td>
-
<td></td>
-
</tr>
-
<tr>
-
<td></td>
-
<td class="menu">
-
<a title="Menu2" href="menu2.php">Menu2</a></td>
-
<td></td>
-
</tr>
-
continues.............
-
</table>
-
<br>
-
<br>
-
<table>
-
</td>
-
<td width="83%" valign="top" class="contents">
-
<!-- InstanceBeginEditable name="content" -->
-
( My PHP lines) ……
-
<!-- InstanceEndEditable -->
-
</td>
-
</tr>
-
</table>
-
<br>
-
<br>
-
<?php
-
include("include/footer.inc");
-
?>
-
</body>
-
<!-- InstanceEnd -->
-
</html>
-
-
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.
13 2970 Dormilich 8,658
Recognized Expert Moderator Expert
sessions have to be initialized, before any output is sent to the browser.
@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.
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.
@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).
Dormilich 8,658
Recognized Expert Moderator Expert
that looks like an error in the session.php file.
@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.
Dormilich 8,658
Recognized Expert Moderator Expert @raamay
without any code I can’t either.
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: - <?php session_start(); ?>
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 ...
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-
<!-- InstanceBeginEditable name="head" -->
-
<!-- InstanceEndEditable -->
-
<link href="css/global.css" rel="stylesheet" type="text/css" />
-
</head>
-
<?php
-
include("include/header.inc");
-
include("include/session.php");
-
?>
-
<body>
-
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 ;)
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.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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...
|
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...
|
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...
|
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...
| |
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
|
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>
|
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...
|
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...
|
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...
|
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...
| |
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...
|
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...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |