You are invited to Log in or Register a free Frihost Account!

Running a "Hello World" php script

I am new to PHP, so I am sure it's something really simple that I'm not doing to make a simple "Hello World" php script run. I went to the DirectAdmin (I read through FAQ's...etc....on the forum, thought I might have missed my answer somewhere). Regardless, Direct Admin states, "PHP scripts may be placed and executed in any folder within your public_html directory." I've done this but some reason there's no "hello world". So, what do you think I might be doing wrong?
The code I got off of
<title>My First PHP Page</title>
echo "Hello World!";

Because Fri Host has a server that is PHP-enabled, that means that I do not need to install PHP on my machine, correct?
hmm .. what exactly is the problem ? did u name the file .php ??

look at ur example on my hosted space:
asfaltboy, yeah I named it test.php
i noticed that your source code for the page is:
<title>My First PHP Page</title>
Hello World!</body>
there was no php tags, but your extension says .php why is that?
also, i noticed you are using http and I am uploading to ftp. could that be the problem? thanks for the reply.
yep, that was the problem. thanks asfaltboy. i was typing in ftp instead of http. thanks again!
cool .. glad that helped Very Happy ... my source was just the html translation of the php script u posted... see the php engine compiles the source into html basically Very Happy ... so what u see is the result of the php runnin on the server.
Extending on what asfaltboy said, PHP is a server-side language. That means that the script runs on the server. So, you don't need to install PHP on your computer to use PHP scripts. It gets installed on the server (in this case, FriHost installed PHP onto their server)

Because it's a server-side language, users of your site can't see the source-code. They see the HTML output of the PHP script.

The official PHP website has more information:
Related topics
Phoenix free PHP scripts
error in my PHP script
how can i make a php script for enter username and password?
Inserting data to MYSQL with a PHP script
Programming in a lot of languages
[PHP] Running Cron Jobs Via PHP Script
Simple PHP script not working
PHP Script- How can we install it
The last foolish PHP/MySQL Question of the Year....
Is there a Python Hello World using Apache?
Running PHP Script without PHP Server?
php script for Changing file permissions & owner
Python hello world
Problem with python script
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

© 2005-2011 Frihost, forums powered by phpBB.