phpinfo does not run in a FRAME

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ianm777
Forum Newbie
Posts: 5
Joined: Thu Dec 07, 2006 10:27 pm

phpinfo does not run in a FRAME

Post by ianm777 »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi there,
I have two systems with Windows XP Pro fully up to date, Explorer 7, Apache, PHP and MySQL.
No 1 is a server type system which I use for backups etc.
As I am travelling around I have tried to set up a Laptop with the same config. as No1.
Trying to develop an application and using HTML frames to try and keep it all tidy and VERY easy to use.
BUT the phpinfo() will not run in a FRAME on the Laptop.  Works OK on No1 system???

Part1.htm is as follows :

[syntax="html"]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<body>


<! <table cellpadding="0" cellspacing="0" width="100%" bgcolor="#808080">

</table>

<table border="0" cellpadding="0" cellspacing="3">

<b>SHIFT</b><br />

<a class="left" target="actframe" href="part0.php"  >SHIFT View</a><br />
<a class="left" target="actframe" href="part2.php" >SHIFT Print</a><br />

<br />
</body>
</html>
Part2.pnp is as follows and this just displays the HTML code and nothing else :[/syntax]

Code: Select all

<html>
<body bgcolor="#EBC79E">

<h3> Part2 Action : </H3>



<p>
Print will test PHP. <br>

</p>

<?php
echo phpinfo();
?>

</body>
</html>

Any help would be appreciated as I have checked my .conf and .ini files MANY times. I presume that it is something VERY simple (and stupid) but that is the way it is.
Currently the Laptop is installed with WAMP but I had the same problem with my previous individual product installs.


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Hard to tell,
ianm777 wrote:BUT the phpinfo() will not run in a FRAME on the Laptop.
Then what does it do?

Try

Code: Select all

<html>
	<head><title>php test</title></head>
	<body bgcolor="#EBC79E">
		<h3> Part2 Action : </H3>
		<p>Print will test PHP.</p>

<?php
echo phpinfo();
if (false) {
	echo '<h1>taadaa</h1>';
}
?>
	</body>
</html>
as Part2.php. What does it print? Please copy&paste.
ianm777
Forum Newbie
Posts: 5
Joined: Thu Dec 07, 2006 10:27 pm

Post by ianm777 »

Thanks for sorting out my post structure for me...

Tried your replacement for Part2.php and all that was printed was :


Part2 Action :
Print will test PHP.


It just seems to go on strike? Run on its own in the browser and it works fine.

Thanks fortrying,
ianm[/quote][/list]
brendandonhue
Forum Commoner
Posts: 71
Joined: Mon Sep 25, 2006 3:21 pm

Post by brendandonhue »

You don't need to echo phpinfo, you just phpinfo().
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

If you "view source" does it show the PHP code in there?
Wade
Forum Commoner
Posts: 41
Joined: Mon Dec 18, 2006 10:21 am
Location: Calgary, AB, Canada

Post by Wade »

Might I suggest creating your default/index/main page as a php file which includes the other parts?

Something like (this is a functioning page that has been stripped down) 'index.php'

Code: Select all

...
<table width="682" border="0" cellspacing="0" cellpadding="4" align="center">
  <tr>
    <td width="666">

<?php
include("header.php")
?>          

    </td>
  </tr>
</table>
<table width="682" border="0" cellspacing="0" cellpadding="0" align="center">
...
</table>
<table width="682" border="0" cellspacing="0" cellpadding="0" align="center">

<?php
include("navbar.php")
?>          

</table>
<table width="684" border="0" cellspacing="0" cellpadding="0" align="center">
  ...
      <table width="99%" border="0" cellspacing="0" cellpadding="0" align="center">
       ...
      </table>
 ...     
<?php
include("footer.php")
?>          
...

</table>
<br>
</body>
</html>
You get the idea.

HTH,
ianm777
Forum Newbie
Posts: 5
Joined: Thu Dec 07, 2006 10:27 pm

Post by ianm777 »

WADE :

Thank you for your suggested code structure using the PHP include.

Unfortunately I do not understand how I would be able to use this construct.
The present structure that I am using enables me to build my user menu which
remains on-screen at all times so that it is very easy for a user to change
tasks within an application. Probably not all that elegant but I will tidy
that up later.

-------------------------------------------------------------------------------------------------------------------------

feyd :

When displaying source code in the (blank) frame it DOES show the PHP code.
So it is getting into the frame. Part2.php also works correctly if it is
run on its own in the browser. So it seems to have something to do with the frame.

I should perhaps stress the fact that this code works exactly as I would expect
on my other system. So I am pretty convinced that it is a parameter which
I have not set correctly in either the Apache .conf file or in the PHP.INI.

--------------------------------------------------------------------------------------------------------------------------

brendandonhue:

That is true. I was just trying the echo to see if it made any difference.
The other system runs it either way as well.

------------------------------------------------------------------------------------------
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

If you can see the PHP source code then PHP is not even looking at the code. It would then seem that your server is either configured incorrectly or your file name is incorrect.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

ianm777 wrote:When displaying source code in the (blank) frame it DOES show the PHP code.
So it is getting into the frame. Part2.php also works correctly if it is
run on its own in the browser. So it seems to have something to do with the frame.
So if you call the php page directly through your browser (using something like http://localhost/php-info-page.php) it processes the PHP, but including it as a source for a frame doesn't parse it? Have you tried renaming your frame page <page-name>.php instead of <page-name>.html? Its a long shot, but that might be your problem.
ianm777
Forum Newbie
Posts: 5
Joined: Thu Dec 07, 2006 10:27 pm

Post by ianm777 »

Hi all,

many thanks for all assistance so far.
feyd has stated my feelings as well so I have posted a "please help" on the WAMP forum pages to see if they can help.
I will also install another browser to see if iy may have something to do with Explorere 7 upgrades???

thanks again,
ianm
ianm777
Forum Newbie
Posts: 5
Joined: Thu Dec 07, 2006 10:27 pm

Post by ianm777 »

SOLVED ....

Solutions are usually fairly simple and often embarrassing.

I fired up the Part1 as a NORMAL FILE in my browser instead of going VIA the localhost. That is why it did not work. The URL for the browser needed to read " http://localhost/BusWise/BW_start.htm " instead of C:\wamp\www\ filename....... "

Very sorry that I wasted a lot of folks time.

best regards,
ianm
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Didn't we ask that? :wink:

Anyway, happy new year. Glad you got it working.
Post Reply