FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Running a "Hello World" php script





earth2
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 http://www.tizag.com/
<html>
<head>
<title>My First PHP Page</title>
</head>
<body>
<?php
echo "Hello World!";
?>
</body>
</html>

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

look at ur example on my hosted space:

http://pash.frih.net/try.php
earth2
asfaltboy, yeah I named it test.php
i noticed that your source code for the page is:
<html>
<head>
<title>My First PHP Page</title>
</head>
<body>
Hello World!</body>
</html>
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.
earth2
yep, that was the problem. thanks asfaltboy. i was typing in ftp instead of http. thanks again!
asfaltboy
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.
Daniel15
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:
http://au.php.net/
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

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.