frames with PHP in Dreamweaver

I am just beginning to work with frames, and in roving through various forums, I can see that I'm entering a bit of a mine field.

My question is probably too dumb, but those are the ones that seem to hang one.  I am using PHP with an Apache server and Dreamweaver MX, and I would like to use php files withm frames.  I would expect Dreamweaver to treat the 'test2.php' file in the following.

 ' <frame src="test2.php" name="mainFrame">'

as any orther php file and send it to the Apache server.(It goes without saying that the php file works on its own.)  It does not appear to me that the php file is being sent to the server - none of the '<?php' commands seems to be recognized. Here is a simple version of the setup.  Advice??

!-- frameset.htm -->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" <html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<frameset rows="80,*" >
  <frame src="test1.php" name="topFrame">
  <frame src="test2.php" name="mainFrame">
</frameset>
</html>

<!-- end frameset.htm -->

<!-- test1.php -->

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php echo "HELLO"; ?>
</body>
</html>

<!-- end test1.php -->

<!-- test2.php -->

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>

</body>
</html>

<!-- end test2.php -->
tdolhantyAsked:
Who is Participating?
 
VGRConnect With a Mentor Commented:
may I suggest you try to open your frameset page using a BROWSER ? ;-)
0
 
VGRCommented:
delete the /HTML when you use a frameset

A frameset page has this general structure, different from a "normal" HTML page :

</HEAD>
<frameset cols="*" rows="140,*" border="0">
 <frame name="monitor" src="monitor.php" scrolling=YES NORESIZE>
 <frameset cols="160,*" border="0">
  <frame name="client" src="client.php" scrolling=YES NORESIZE>
  <frame name="affiche" src="affiche.php?buttREFR=1" scrolling=YES>
 </frameset>
</frameset>
<NOFRAME>

Vous ne visualisez pas les cadres. Vous ne verrez que les messages.<BR>
You're not able to see frames. You'll see only the messages.<BR>

</NOFRAME>


-------------
Your frameset.htm file seems correct to me if you make it this way :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
(ie you forgot the closing > and please put a line before <HTML>, just for readability)

and at the end you may provide a <NOFRAME> section, and no </HTML>

personally, I wouldn't also issue a <!DOCTYPE, but it's up to you.

Apparently, IE is happy with incorrect HTML - and it's not the first case I constate this ! -

in a word as in twenty :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<frameset rows="80,*" >
 <frame src="test1.php" name="topFrame">
 <frame src="test2.php" name="mainFrame">
</frameset>
<noframe>
no frames available
</NOFRAME>
0
 
tdolhantyAuthor Commented:
Thanks for the response VGR.  My main problem, however, remains.  That is, I am expecting test2.php to act like a php file when I preview it in Dreamweaver MX (IE 6.0).(That is, I expect test2.php to echo 'Hello' in 'mainFrame' in this case).  It does not.  It simply acts like an htm file.
0
 
tdolhantyAuthor Commented:
VGR - Again, thanks.  And this time, BINGO.  As I said initially, a simple question, but - yada, yada, yada.  Now why previewing out of Dreamweaver MX couldn't handle that is a mystery to me.  Nevertheless, I toddle on.
0
 
VGRCommented:
yes, it's only the second time I see people having problems with MX

I don't use it so far. I think I will not 8-)

I recommend (it's no more difficult) to use a text editor (MX if you want, but NoteTab/NotePad/WordPad will do), and a browser.
You turn the URL to http://localhost/yourpath/yourfile.php

and each time you want to see the results of code modification, you press "reload"

that's it.

No longer than pressing F9, F11 or whatever MX uses for previewing.

MX support for scripting languages is insufficient (MX does not behave as a true browser))
0
All Courses

From novice to tech pro — start learning today.