473,583 Members | 2,908 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1634
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.p hp" />';

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.p hp" />';
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.comwro te 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.p hp" />';

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
19113
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 register_globals was set to ON. The client then notified his host who seemed to know exactly the issue and we added these lines to the top of the...
0
1550
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 required 'DB.php' (include_path='.;C:\php5\p ear') in d:\web\cmd_drawings.php on line 5
1
3528
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 script) and that is including 2 other files: config.inc (PHP5 script, for the configuration) and adodb.inc.php (PHP4 script, ADOdb functionality,...
4
2794
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: main(/includes/ReloadScript.html) : failed to open stream: No such file or directory in /usr/local/www/htdocs/main/AOLCompression.php on line 14 Fatal error: main() : Failed...
1
2194
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 ---- class A { //... }
3
3440
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 running well, except the old php scripts. Plz bare with me I'm not a programmer, I've spent a month researching the PHP manual, the net, other forum and...
9
5250
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 which was perfectly alright and worked well. But now PHP5 fails to run the same script without any modification!
8
1593
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 moved, which are straight php and do not use mysql are working fine though. So it seems that the mysql php interface maybe the problem. Are there any...
7
4414
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 binary from php.net) as an Apache 2.0.55 module on Windows XP. I have enabled the xsl extension - php_xsl.dll - in php.ini and indeed, when I look...
0
7896
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8329
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7936
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8197
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5704
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5377
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3821
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1436
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1160
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.