Connecting Tech Pros Worldwide Forums | Help | Site Map

php5 and include problem

Tom
Guest
 
Posts: n/a
#2: Jun 2 '08

re: php5 and include problem


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



Rik Wasmus
Guest
 
Posts: n/a
#1: Jun 2 '08
Guillaume wrote:
Quote:
Tom a écrit :
Quote:
>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]
Guillaume
Guest
 
Posts: n/a
#3: Jun 2 '08

re: php5 and include problem


Tom a écrit :
Quote:
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
Tom
Guest
 
Posts: n/a
#4: Jun 2 '08

re: php5 and include problem


TNx for help!

"Rik Wasmus" <luiheidsgoeroe@hotmail.comwrote in message
news:482c2a93$0$22075$6e1ede2f@read.cnntp.org...
Quote:
Guillaume wrote:
Quote:
>Tom a écrit :
Quote:
>>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]

Closed Thread