?
Solved

frames with PHP in Dreamweaver

Posted on 2003-03-24
5
Medium Priority
?
337 Views
Last Modified: 2012-05-04
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 -->
0
Comment
Question by:tdolhanty
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 15

Expert Comment

by:VGR
ID: 8197386
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
 

Author Comment

by:tdolhanty
ID: 8197536
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
 
LVL 15

Accepted Solution

by:
VGR earned 1000 total points
ID: 8197614
may I suggest you try to open your frameset page using a BROWSER ? ;-)
0
 

Author Comment

by:tdolhanty
ID: 8198143
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
 
LVL 15

Expert Comment

by:VGR
ID: 8198182
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question