ali_kiyani Posted August 22, 2006 Share Posted August 22, 2006 HiI 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 ashttp://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. Quote Link to comment https://forums.phpfreaks.com/topic/18276-solved-php-code-not-running/ Share on other sites More sharing options...
trq Posted August 22, 2006 Share Posted August 22, 2006 Silly question but, do you have php installed? Quote Link to comment https://forums.phpfreaks.com/topic/18276-solved-php-code-not-running/#findComment-78468 Share on other sites More sharing options...
HuggieBear Posted August 22, 2006 Share Posted August 22, 2006 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'RegardsRich Quote Link to comment https://forums.phpfreaks.com/topic/18276-solved-php-code-not-running/#findComment-78506 Share on other sites More sharing options...
willpower Posted August 22, 2006 Share Posted August 22, 2006 have you ensured that you have the file extensions right...ie does the imgae names have .jpg or .gif etc after them? Quote Link to comment https://forums.phpfreaks.com/topic/18276-solved-php-code-not-running/#findComment-78510 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.