DeveloperBarn Forums

Go Back   DeveloperBarn Forums > Programming & Scripting > PHP Development

Discuss "PHP code displays in browser" in the PHP Development forum.

PHP Development - PHP is a powerful open source scripting language. Learn coding practices and tips to get the best out of your PHP pages.


Closed Thread
 
LinkBack (1) Thread Tools Display Modes
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 03-31-2008, 01:46 PM
New Member
 
Join Date: Mar 2008
Posts: 14
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 1
theChris is an unknown quantity at this point
Default PHP code displays in browser

Hi, I'm trying out my first simple php snippet, but the code is displaying in the browser instead of executing. Can you see what I'm doing wrong? Here's the code:

PHP Code:
<?php
echo "Hello World";
?>
But the browser ouputs:
Quote:
<?php
echo "Hello World";
?>
What am I doing wrong??
Sponsored Links
  #2 (permalink)  
Old 03-31-2008, 02:03 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 397
Thanks: 12
Thanked 20 Times in 20 Posts
Rep Power: 1
jmurrayhead is on a distinguished road
Default

Sounds like the server you are on doesn't support PHP. If the site is hosted, then you can verify with them if they have it setup to run PHP apps or not.
__________________
jmurrayhead
Did I help you out? Make me popular by clicking the icon!

If you found a post helpful, please click the button in the lower right-hand corner of the post.

Powered by ASP.Net
  #3 (permalink)  
Old 03-31-2008, 02:53 PM
Wolffy's Avatar
Slaprentice of Wolves

 
Join Date: Mar 2008
Location: Peoria, IL
Posts: 91
Thanks: 1
Thanked 15 Times in 12 Posts
Rep Power: 1
Wolffy is on a distinguished road
Default

Probably stating the obvious, but ensure your file type is .php, not .htm or .html. I spent an hour once on this one.

Comments on this post
theChris agrees: thanks to both of you, I can only give to Wolffy though
  #4 (permalink)  
Old 03-31-2008, 03:29 PM
New Member
 
Join Date: Mar 2008
Posts: 14
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 1
theChris is an unknown quantity at this point
Default

Thanks guys, I'm running this off of my local Windows machine. Do I have to do something to get it to work? My ASP scripts run fine without having to do anything special.

Thanks
  #5 (permalink)  
Old 03-31-2008, 03:32 PM
Wolffy's Avatar
Slaprentice of Wolves

 
Join Date: Mar 2008
Location: Peoria, IL
Posts: 91
Thanks: 1
Thanked 15 Times in 12 Posts
Rep Power: 1
Wolffy is on a distinguished road
Default

Yup, you need to install PHP on your machine. Take a look at PHP: Hypertext Preprocessor for the downloads.
  #6 (permalink)  
Old 03-31-2008, 05:16 PM
New Member
 
Join Date: Mar 2008
Posts: 14
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 1
theChris is an unknown quantity at this point
Default

Thanks guys, I found this from that website: PHP: Windows Installer (PHP 5.1.0 and earlier) - Manual

I was able to get everything working from doing this. Thanks again.
Closed Thread

  DeveloperBarn Forums > Programming & Scripting > PHP Development

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.developerbarn.com/php-development/88-php-code-displays-browser.html
Posted By For Type Date
DeveloperBarn Forums - ASP Help, ASP.Net Help, PHP Help, SQL Help, Tutorials, Windows Help This thread Refback 04-26-2008 09:34 AM


Sponsored Links

ASP.NET Resource Index
a directory of ASP.NET tutorials, applications, scripts, assemblies and articles for the novice to professional developer.

Free Web Directory
Including Chats and Forums Resources, Offer automatic, instant and free directory submissions.
URLZ Web Directory
URLZ Web Directory

Free Web Directory - Add Your Link
The Little Web Directory
Free Web Directory
Pegasus free web directory is a free directory organised by categories.


All times are GMT -4. The time now is 01:06 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 RC7
©2008 DeveloperBarn.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45