0

New to php and taking a class for it. Bought php6 and mysql 6 bible to get started. Of course the hello world script is the first you get and it doesn't show. It just reads part of my script and I'm not sure the problem. Link to test - http://harden6615.com/

I am using a hosted server I bought for class, but I have also check it using MAMP. I figured my script is wrong, but I have copied and pasted and still no Hello World. Any suggestions?

What I copied:

<?php
print("Hello, World<BR />\n");
phpinfo();
?>
4

4 回答 4

2

Safe the file as index.php instead of index.html.

于 2012-06-10T22:33:03.507 回答
1

清单:

  • 主机允许 PHP
  • 文件具有.php扩展名
  • 文件是用程序员的文本编辑器编辑的(不是 windows 下的 word/wordpad 或 Mac 下的 TextEdit),因为在保存文件时有些编码< , >符号
于 2012-06-10T22:45:23.683 回答
0

Well actually it isn't, try to use just <?php phpinfo(); ?> If this doesn't show anything - take a look at your webhost if he supports php...

于 2012-06-10T22:32:08.417 回答
0

There are a few reasons why PHP may not be being executed.

The most basic error is saving the file as a .html file instead of .php. Make sure you use the correct extension on your file.

Next, make sure your webhost supports PHP. Most free hosts do not, so it's always a good idea to double-check.

There is nothing wrong with your code. If the above two solutions didn't help, try contacting your webhost and asking them why PHP isn't working for you.

于 2012-06-10T22:36:35.123 回答