I don't think you can use "include" as a src, as "include" executes the php
script where the iframe wants a url location to load.
Try this ...
<iframe src="<?php getenv('DOCUMENT_ROOT') .
'/PATH-TO-FILE-FROM-DOCUMENT_ROOT-location/.main.php'; ?>" ...
Just update the path to the file starting from the document root.
You can also use $_SERVER['DOCUMENT_ROOT'] for the getenv function, they are
mostly the same.
Hope that helps,
Terre
-----Original Message-----
From: David Toniolo [mailto:[email protected]]
Sent: Thursday, March 05, 2009 2:32 PM
To: [email protected]
Subject: Re: [fw-general] Using HTML iframes with ZendFramework
solved. Path has to be in docroot, include_path settings do not catch here,
because it's HTML. I tried to do something like this:
<iframe src="<?php include '../tools/galerie/.main.php'; ?>"
but it did not work. So, i created a PHP file in docroot with only 1 line:
<?php require_once 'tools/galerie/main.php'; ?>
and that works. I do not like this solution with an extra PHP file in
docroot, maybe someone knows a better solution.
David Toniolo wrote:
>
> hello,
>
> there is a problem with using iframes in view scripts. In the src
> attribute of the iframe is a path like this:
>
> <iframe src="../tools/galerie/main.php">
>
> The PHP file should be called an that's it. It works under XAMPP
> Windows but not on Linux. ZF version is equal on both systems
(1.7.2-minimal).
> On Linux ZF routing throws message "Invalid controller specified
> (galerie)" in the iframe.
>
>
> I tried to change rewrite rules in htaccess and all PHP files are not
> routed anymore by index.php (bootstrap). This did not solve the
> problem, now the server answers with "Not found".
>
> Any ideas?
>
--
View this message in context:
http://www.nabble.com/Using-HTML-iframes-with-ZendFramework-tp22355424p22358
839.html
Sent from the Zend Framework mailing list archive at Nabble.com.