Jump to content

[SOLVED] PHP code not running


ali_kiyani

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.
Link to comment
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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.