473,698 Members | 2,339 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

load frameset file form php include?

Hello

I'm having a problem loading a frameset file using an include in a php
file.

Nothing is displayed and when I look at the source code I see that

<html>
<head>
<title></title>
</head>
<body>
</body>
</html>

is above the frameset code - and presumably because the <body></body>
tags are there, the frameset will not work?

How can I correct this?

Cheers

Geoff
Aug 13 '08 #1
12 5615
On 13 Aug, 21:25, Geoff Cox <g...@freeuk.no tcomwrote:
Hello

I'm having a problem loading a frameset file using an include in a php
file.

Nothing is displayed and when I look at the source code I see that

<html>
<head>
<title></title>
</head>
<body>
</body>
</html>

is above the frameset code - and presumably because the <body></body>
tags are there, the frameset will not work?

How can I correct this?

Cheers

Geoff
Damn, there I was carefully looking at your code, when my crystal ball
died!
Aug 13 '08 #2
On Wed, 13 Aug 2008 13:36:14 -0700 (PDT), Captain Paralytic
<pa**********@y ahoo.comwrote:
>On 13 Aug, 21:25, Geoff Cox <g...@freeuk.no tcomwrote:
>Hello

I'm having a problem loading a frameset file using an include in a php
file.

Nothing is displayed and when I look at the source code I see that

<html>
<head>
<title></title>
</head>
<body>
</body>
</html>

is above the frameset code - and presumably because the <body></body>
tags are there, the frameset will not work?

How can I correct this?

Cheers

Geoff

Damn, there I was carefully looking at your code, when my crystal ball
died!
OK!

1. The php file which has the include

<?php
@require(dirnam e(__FILE__) . '/../../config_php/config.php');

$name_of_user = $_SERVER['REMOTE_USER'];

$link = mysql_connect(
$conf['sql']['host'],
$conf['sql']['user'],
$conf['sql']['pass']
) or die ("cannot make connection to {$conf['sql']['db']}");

$query ="select * from best_users where " . "user_name " ."like" .
"'%" . mysql_real_esca pe_string($name _of_user) . "%'"; // OK

if (mysql_select_d b($conf['sql']['db'],$link)) {

$result = mysql_query($qu ery, $link);

if ($result) {
while ($row = mysql_fetch_arr ay($result)) {

for ($n=0; $n<7;$n++) {
if ($row[$n]==1) {
include 'menu.htm';
}
}

}

} else {
echo mysql_error();
}

}

?>
2. and in menu.htm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Untitled </title>
</head>

<!-- frames -->
<frameset rows="75,*">
<frame src="topbar-frameset-2.php" name="topbar" scrolling="no">
<frame src="frameset2. htm" name="Display">
<noframes><BODY >
<!-- Alternative non-framed version -->
need frames browser
</body></noframes>
</frameset>
</frameset>

</html>

3. what I see when I look at the source code for the page created by
the php file above

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Untitled </title>
</head>

<body>

</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Untitled </title>
</head>

<!-- frames -->
<frameset rows="75,*">
<frame src="topbar-frameset-2.php" name="topbar" scrolling="no">
<frame src="frameset2. htm" name="Display">
<noframes><BODY >
<!-- Alternative non-framed version -->
need frames browser
</body></noframes>
</frameset>
</frameset>

</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Untitled </title>
</head>

<!-- frames -->
<frameset rows="75,*">
<frame src="topbar-frameset-2.php" name="topbar" scrolling="no">
<frame src="frameset2. htm" name="Display">
<noframes><BODY >
<!-- Alternative non-framed version -->
need frames browser
</body></noframes>
</frameset>
</frameset>

</html>

Cheers

Geoff

Aug 13 '08 #3
On Aug 13, 4:01*pm, Geoff Cox <g...@freeuk.no tcomwrote:
On Wed, 13 Aug 2008 13:36:14 -0700 (PDT), Captain Paralytic
I am not going to quote all of your long code, but only the following
bit:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
If you are using html 4.01, you must use the frame set version of html
4.01, not transitional or strict. If you use an iframe, you may use
either the frameset or transitional version of html 4.01, but not
strict. Often the page will work with the wrong Doctype, but it will
not validate at the W3C validator. However I would correct the Doctype
before looking for other errors and I would next validate at W3C to
get rid of any other possible errors before looking for more exotic
problems.

Aug 13 '08 #4
On Wed, 13 Aug 2008 16:14:22 -0700 (PDT), cwdjrxyz
<sp*******@cwdj r.infowrote:
>On Aug 13, 4:01*pm, Geoff Cox <g...@freeuk.no tcomwrote:
>On Wed, 13 Aug 2008 13:36:14 -0700 (PDT), Captain Paralytic

I am not going to quote all of your long code, but only the following
bit:
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

If you are using html 4.01, you must use the frame set version of html
4.01, not transitional or strict. If you use an iframe, you may use
either the frameset or transitional version of html 4.01, but not
strict. Often the page will work with the wrong Doctype, but it will
not validate at the W3C validator. However I would correct the Doctype
before looking for other errors and I would next validate at W3C to
get rid of any other possible errors before looking for more exotic
problems.
thanks for the suggestions - I have carrired out both but still have
the problem!

Cheers

Geoff
Aug 14 '08 #5
On Wed, 13 Aug 2008 13:36:14 -0700 (PDT), Captain Paralytic
<pa**********@y ahoo.comwrote:
>Damn, there I was carefully looking at your code, when my crystal ball
died!
1. if I use a simple php file and menu.htm the frames work

<?php
include 'menu.htm';
?>

and menu.htm being

<html>
<head>
<title>Untitled </title>
<meta http-equiv="Content-Type" content="text/html;charset=ut f-8" >
</head>

<!-- frames -->
<frameset rows="75,*">
<frame src="topbar-frameset.htm" name="topbar" scrolling="no">
<frame src="frameset2. htm" name="Display">

<noframes><body >
<!-- Alternative non-framed version -->
need frames browser
</body>
</noframes>
</frameset>

</html>
2. if I use the more complicated php file and the same menu file the
frames do not work because for some reason this has been added above
the included frameset code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled </title>
</head>
<body>
</body>
</html>

Where does this come from?!

Cheers

Geoff

3. the more complicated php file

<?php
@require(dirnam e(__FILE__) . '/../../config_php/config.php');

//$name_of_user = ($_POST['username']);

$name_of_user = $_SERVER['REMOTE_USER'];

$link = mysql_connect(
$conf['sql']['host'],
$conf['sql']['user'],
$conf['sql']['pass']
) or die ("cannot make connection to {$conf['sql']['db']}");

$query ="select * from best_users where " . "user_name " ."like" .
"'%" . mysql_real_esca pe_string($name _of_user) . "%'"; // OK

if (mysql_select_d b($conf['sql']['db'],$link)) {

$result = mysql_query($qu ery, $link);

if ($result) {
while ($row = mysql_fetch_arr ay($result)) {

for ($n=0; $n<7;$n++) {
if ($row[$n]==1) {
//echo $n . "<br>";

//include 'ajax-groups-'. $n . ".htm";
include 'menu-'. $n . ".htm";

}
}

}

} else {
echo mysql_error();
}

}

?>
Aug 14 '08 #6
Message-ID: <pm************ *************** *****@4ax.comfr om Geoff Cox
contained the following:
>2. if I use the more complicated php file and the same menu file the
frames do not work because for some reason this has been added above
the included frameset code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled </title>
</head>
<body>
</body>
</html>

Where does this come from?!
Well it won't appear by magic.

What's in config.php?

--
Geoff Berrow 011000100110110 0010000000110
001101101011011 001000110111101 100111001011
100110001101101 111001011100111 010101101011
http://slipperyhill.co.uk
Aug 14 '08 #7
On Thu, 14 Aug 2008 08:55:12 +0100, Geoff Berrow
<bl******@ckdog .co.ukwrote:
>Message-ID: <pm************ *************** *****@4ax.comfr om Geoff Cox
contained the following:
>>2. if I use the more complicated php file and the same menu file the
frames do not work because for some reason this has been added above
the included frameset code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled </title>
</head>
<body>
</body>
</html>

Where does this come from?!

Well it won't appear by magic.

What's in config.php?
Geoff,

Brilliant!

config.php has <htmletc tags - removing them and the frameset file
loads OK.

Many thanks - I was going round in circles and would not have thought
to look in config.php thinking it was simply read to get the mysql
access details.

Cheers,

Geoff
Aug 14 '08 #8
cwdjrxyz wrote:
On Aug 13, 4:01 pm, Geoff Cox <g...@freeuk.no tcomwrote:
>On Wed, 13 Aug 2008 13:36:14 -0700 (PDT), Captain Paralytic

I am not going to quote all of your long code, but only the following
bit:
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

If you are using html 4.01, you must use the frame set version of html
4.01, not transitional or strict. If you use an iframe, you may use
either the frameset or transitional version of html 4.01, but not
strict. Often the page will work with the wrong Doctype, but it will
not validate at the W3C validator. However I would correct the Doctype
before looking for other errors and I would next validate at W3C to
get rid of any other possible errors before looking for more exotic
problems.

Which has absolutely nothing to do with the fact the incorrect code is
being generated...

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Aug 14 '08 #9
On Aug 14, 8:32*am, Jerry Stuckle <jstuck...@attg lobal.netwrote:
cwdjrxyz wrote:
On Aug 13, 4:01 pm, Geoff Cox <g...@freeuk.no tcomwrote:
On Wed, 13 Aug 2008 13:36:14 -0700 (PDT), Captain Paralytic
I am not going to quote all of your long code, but only the following
bit:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
If you are using html 4.01, you must use the frame set version of html
4.01, not transitional or strict. If you use an iframe, you may use
either the frameset or transitional version of html 4.01, but not
strict. Often the page will work with the wrong Doctype, but it will
not validate at the W3C validator. However I would correct the Doctype
before looking for other errors and I would next validate at W3C to
get rid of any other possible errors before looking for more exotic
problems.

Which has absolutely nothing to do with the fact the incorrect code is
being generated...
I say it has everything to do with the fact that incorrect code is
being generated. If you want W3C valid code, you do not use frames
with html 4.01 transitional, you must use frameset html 4.01, although
iframes would be allowed for 4.01 transitional. The code for the page
can not be valid no matter what else it includes if a frame is used.
Of course most html browsers are so loose with standards that the page
may work anyway with invalid code. Such is not the case with xhtml 1.1
properly served as application/xhtml+xml. In such a case the page is
parsed as xml and no parsing errors are allowed by W3C standards. Thus
you get an error message from the xml parser rather than a view of the
page. An html page with errors often allows you to view the page,
although it may not be what you had in mind. One should always clean
up the html or xhtml code to validate as html or xhtml and css at the
W3C before looking for other possible errors in the code.

Aug 22 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
6730
by: Dave B | last post by:
Does anyone know of a program that will read a text file and fill in a web form with the contents of that file? We need to get about 3000 records (5 fields to each record) into a database owned by another company and the only way it can be done (according to them) is to enter them one at a time into a web form. We can get the records into a comma or tab separated text file and would like to just read the file and auto insert the fields...
2
5091
by: luu duong | last post by:
I know this is probably easy but here is the details. I have an asp page that is not inside a frameset. I want to post data to another asp page that is inside a frameset. So firstpage.asp has action="response.htm" target="results". response.htm... <HTML> <FRAMESET ROWS="50%,50%"> <FRAME SRC="header.asp" NAME="fTop"> <FRAME SRC="another.asp" NAME="results">
1
1849
by: CST | last post by:
Hi All, I have a "Digital Dashboard" that basically has 4 IFrame sections. The page flows in the following order: Messages, Stocks, Weather, User Links. Please note that this order needs to stay that way. Everything but the Stocks section is pulled from our dB. I am using the server control InetCtls.Inet to obtain the stock data from Yahoo Finance. The question I have is can I load the page using the dB driven sources
2
10724
by: vk | last post by:
I have a situation where I have 3 frames. The first frame is dynamic and contains javascript variables for use throughout the frameset page and the other frames. Everything works fine...except that the first frame NEEDS to be loaded first so that the other pages can access its variables. What happens in IE is that the frames load up randomly (or so it seems). So sometimes everything blows b/c the first frame did not load first and...
2
2485
by: Mark Kamoski | last post by:
Hi-- I need a code sample of how to redirect from an ASP.NET page to a frames-based html page and specifying what should load in the destination's frames. Any ideas? (Even air-code is much appreciated.)
0
1817
by: aj123 | last post by:
I have freamset in my web application <frameset rows="138,*" cols="*" framespacing="1" frameborder="NO" border="1" bordercolor="#3366CC"> <frame src="Header.aspx" name="topFrame" scrolling="NO" noresize > <frameset rows="*" cols="261,*" framespacing="0" frameborder="yes" border="0"> <frame src="Left.aspx" name="leftFrame" scrolling="NO" > <frame src="main.html" name="mainFrame"> </frameset> </frameset
7
1432
by: nathanwb | last post by:
I have a set of file that I would like to use between the hours of 7am - 9pm, and then another set from 9pm - 7am. Am I on the right track with this code? Thanks for any help.... <?php $h = date('h'); if ($h < 09) {
1
1566
by: rajkpy | last post by:
Hi Expert, Please help. Please look at the code below for 'include.php', which is included in every php file of my application //Include.php <?php session_start(); if(!session_is_registered("SESSION")){ $home_url = 'http://'. $_SERVER.'/admin_dev/authentication/login.php'; header('Location: ' . $home_url); exit();
0
8674
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
8603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5860
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
4369
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3046
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
2329
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2001
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.