470,862 Members | 1,809 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,862 developers. It's quick & easy.

php5 and include problem

Tom
Hi all i have problem with include function in my code after change php4 to
php5.

after standard html code i put in html body <? include ("filename.php"); ?>
and close body and html.
With php4 i got pictures from php file but now in php5 i got blank page.
any suggestion?
tnx
Jun 2 '08 #1
3 1531
Tom a écrit :
Hi all i have problem with include function in my code after change php4 to
php5.

after standard html code i put in html body <? include ("filename.php"); ?>
and close body and html.
With php4 i got pictures from php file but now in php5 i got blank page.
any suggestion?
tnx
First, use <?php instead of <?
Second... If I understand, filename.php generates a picture. Then, don't
"include" it, rather use echo '<img src="filename.php" />';

If not, then the code from filename.php should be required, cause your
problem is quite unclear atm but one thing is sure, the problem doesn't
come from the "include" function, rather from the included code...

Regards,
--
Guillaume
Jun 2 '08 #2
Guillaume wrote:
Tom a écrit :
>Hi all i have problem with include function in my code after change
php4 to php5.

after standard html code i put in html body <? include
("filename.php"); ?and close body and html.
With php4 i got pictures from php file but now in php5 i got blank page.
any suggestion?
tnx

First, use <?php instead of <?
Second... If I understand, filename.php generates a picture. Then, don't
"include" it, rather use echo '<img src="filename.php" />';
If I had to guess, the problem is definitely the first one. If it works
in PHP 4, the file doesn't return a raw image, as HTML doesn't change
depending on the PHP version. A default disable of short_tags does :).

Probably the OP has a nice <? include(..);?in his HTML source, which
is discarded/not shown as a malformed HTML tag in most UA's. So an extra
note to the OP: validating pages (http://validator.w3c.org) is a good
thing when output is rendered in an unexpected manner.
--
Rik Wasmus
[SPAM]
Now looking for some smaller projects to work on to fund a bigger one
with delayed pay. If interested, mail rik at rwasmus.nl
[/SPAM]
Jun 2 '08 #3
Tom
TNx for help!

"Rik Wasmus" <lu************@hotmail.comwrote in message
news:48***********************@read.cnntp.org...
Guillaume wrote:
>Tom a écrit :
>>Hi all i have problem with include function in my code after change php4
to php5.

after standard html code i put in html body <? include ("filename.php");
?and close body and html.
With php4 i got pictures from php file but now in php5 i got blank page.
any suggestion?
tnx

First, use <?php instead of <?
Second... If I understand, filename.php generates a picture. Then, don't
"include" it, rather use echo '<img src="filename.php" />';

If I had to guess, the problem is definitely the first one. If it works in
PHP 4, the file doesn't return a raw image, as HTML doesn't change
depending on the PHP version. A default disable of short_tags does :).

Probably the OP has a nice <? include(..);?in his HTML source, which is
discarded/not shown as a malformed HTML tag in most UA's. So an extra note
to the OP: validating pages (http://validator.w3c.org) is a good thing
when output is rendered in an unexpected manner.
--
Rik Wasmus
[SPAM]
Now looking for some smaller projects to work on to fund a bigger one with
delayed pay. If interested, mail rik at rwasmus.nl
[/SPAM]

Jun 2 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by gf | last post: by
reply views Thread by Joe | last post: by
1 post views Thread by Pedro Fonseca | last post: by
1 post views Thread by Arne Claus | last post: by
8 posts views Thread by Tony B | last post: by
7 posts views Thread by Chuck Anderson | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.