Jump to content

Archived

This topic is now archived and is closed to further replies.

ali_kiyani

[SOLVED] PHP code not running

Recommended Posts

Hi

I have an index.php page which contain some include files. When I run this page it doesn't run the PHP code. It just displays HTML code.
All images are being displayed dynamically by getting image name from database but it doesn't show any of the images. When I right click on image in IE and check its properties the image path is shown as

http://localhost/mysite/images/<? $image_name ?>

I tried running the code on IIS 5 (Win2K) and IIS 6(WinXP) but same problem.

Then I ran it on Linux but there it displays all the text in Chinese language (or some other) and also displays all the PHP code as it is without running it on server.

Share this post


Link to post
Share on other sites
Silly question but, do you have php installed?

Share this post


Link to post
Share on other sites
If you have PHP with installed, you'l need to make sure you have the "short_open_tag" set to on as I notice you're using [color=red]<?[/color] as an opening tag as opposed to [color=red]<?php[/color].

Assuming this is all ok then try:

[code]http://localhost/mysite/images/<? echo "$image_name"; ?>[/code]

# Note the 'echo'

Regards
Rich

Share this post


Link to post
Share on other sites
have you ensured that you have the file extensions right...ie does the imgae names have .jpg or .gif etc after them?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.