Jump to content

Having Trouble Running a Script


coolgamer48

Recommended Posts

Hey,I'm just beginning to learn PHP. I've written (well, copied would be more accurate) the simple echo "Hello World" script that the tutorial gives you, and I uploaded it to a web sever that says it supports PHP (Free Hostia, if anyone knows of it). When I click on the link though, nothing happens. A blank window comes up. Does this mean the site actually doesn't support PHP, or am I doing something wrong?In short, could someone please give a web host that supports PHP, and give a quick explanation on what to do so that it should work? I know that I can just set it up on my own PC too. I downloaded and installed the lasted version of PHP, but I think I need some other program (like a sever program or something). Could someone explain that to me and also how to make it work?Please and thank you!

Link to comment
Share on other sites

Well... PHP is hard to configure manually. You need Apache and MySQL (if u wanna work with Data Bases).There are several programs on the Internet that configures all that for you, like:Wamp, AppServ, Xamp...I personally use AppServ http://www.appservnetwork.com/Now, the typical "Hello World" script is as simple as this:

<?phpecho "Hello World";?>

There you go!!

Link to comment
Share on other sites

Right click on the page, select "View Source" or "Source", and see that it isn't displaying the PHP code in there. http://awardspace.com/ is free (or pay for more features, space, bandwidth, etc.) that allows you to use PHP and MySQL database. Make sure you create the subdomain you want to use for your site, and disable or password protect your FTP account you can use from them because if you replace http with ftp in the address bar, they would be able to download the files and see your code, which they shouldn't see when going to your site as PHP code is ran on the server.

Link to comment
Share on other sites

I'm just beginning to learn PHP. I've written (well, copied would be more accurate) the simple echo "Hello World" script that the tutorial gives you, and I uploaded it to a web sever that says it supports PHP (Free Hostia, if anyone knows of it). When I click on the link though, nothing happens. A blank window comes up. Does this mean the site actually doesn't support PHP, or am I doing something wrong?
Did you give the file with the PHP in it the extension .php? Freehostia, as far as I am aware, supports almost all of PHP (except the mail() function for free users).I use WAMP (Google it) for my local server (on my PC).
Link to comment
Share on other sites

is it a wml or html page hmmm i bet you only using php on the page
I'm not exactly sure what you mean. I uploaded the file test1.php Here are the file's contents:
<html>	<body>	<?php	$txt="Hello World";	echo $txt;	?>	</body></html> 

I realize I could have just used

echo "Hello World";

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...