473,395 Members | 1,571 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 1626
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: gf | last post by:
I had a client recently contact me with a script that wasn't working. I quickly isolated the problem as to the fact that the $_GET array was not being made available to all scripts, even though...
0
by: Joe | last post by:
I have just upgrade to php5 and installed pear with gopear.bat on my windows installation. Problem: I get this error when i try to run my cli scripts: Fatal error: main(): Failed opening...
1
by: Pedro Fonseca | last post by:
Greetings everyone! I'm porting my applications to PHP5 and I've stumbled on yet another problem. I'll try to simplify things a bit. I have a main script that is being executed (index.php, PHP5...
4
by: Mxsmanic | last post by:
The require() I'm using in a PHP script has stopped working after I moved from PHP4 and Apache 1.3.x to PHP5 and Apache 2.x. Now I get messages like this: Warning:...
1
by: Arne Claus | last post by:
Hi. I've got a strange problem here with PHP5 (5.0.4). I've got file A, defining a class A and a file B, which sets up an Object of A (aObj) in the global scope like this. ----- A.php ----...
3
by: abeb | last post by:
Hi all, I recently given a task to upgrade a running server (PostgreSQL7.3+Apache2.0+PHP4.2) to a new server with PostgreSQL8.1+Apache2.2+PHP5.1 installed (all Fedora Core 6 packages). All is...
9
by: java | last post by:
Hey there, I just removed an elderly PHP4-Installation from my Windows-Box and installed PHP 5.2.1. I used the PHP4-Module as local batchfile- interpreter by E:\ersDHCP>php ./extractLog.php ...
8
by: Tony B | last post by:
Hi, I'm trying out my local copy of a site that uses php4, mysql,apache2. I've moved it from a php4 machine to a php5 machine, and it doesn't work at all now. A couple of other php4 sites I've...
7
by: Chuck Anderson | last post by:
I can tell I'm not alone in my confusion, as I've been using Google to find a solution to this problem and all I can find is the same question, but no solution. I am running Php 5.25 (Windows...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.