Blank page for simple "hello world" test for HTML and PHP

Hi,
I’m learning about PHP and did the common “hello world” test. This page works on my local server but I can’t get anything to work on this website. I just get blank screens. Am I missing a step to upload something correctly? I added the name/file to the upload area and then clicked the file on the website since I don’t have an index page.

Can you post the full code?

<?php echo "Hello world";

etc

Thank you for your quick help. I’ve since fixed the HTML, so I must be uploading right but I still can’t get php to show. Here is the code for my php file.

helloWorld <?php print "

Hello World!

"; ?>

I just realized what I put is not what is being printed nor is showing right in the preview. I wouldn’t never write code like that. lol

I can’t figure out how to copy and paste my code without this website messing it up.

Try [code] tags followed by /code in the next one.

<!DOCTYPE html>
<html lang = "en-US"> 
<head>
  <meta charset = "UTF-8" />
  <title>helloWorld</title>
</head>
<body>
<?php
	print "<h1>Hello World!</h1>";
?>
</body>
</html>

Where do you upload it?

http://e107install.000webhostapp.com/helloworld.php

http://swingcriollo.uphero.com/Hw2.php This is supposed to be the page. and below is what my screen looks like. I don’t know why this interactive but almost advertising like banner says that I don’t haven’t anything uploaded. But the picture after this shows that I do when I click on the file manager. I also don’t find it easy to check on my page after I have uploaded it. My account is free with a free domain so I’m not expecting the best. Edit. I’ll put the next picture in another replay. It will only let me put in one picture for a new user.

http://cosies-liver.000webhostapp.com/Hw2.php
Maybe?

Both ttps://cosies-liver.000webhostapp.com/hlm.html and ttp://swingcriollo.uphero.com/hlm.html work the same. The Hello world for HTML works on both this site and my home server.

Both ttps://cosies-liver.000webhostapp.com/Hw2.php and ttp://swingcriollo.uphero.com/Hw2.php have blank pages. This same code will work on my home server, but not on this server.

This makes me think there is something that this server that will not accept about my php, but I don’t know what it is. Is there are certain version of PHP that is required maybe?

*Note, I had to take off all the h’s before each of the 4 links because I was not allowed to post links. Is this another restriction that I have because I’m a newbie?

Wow, do I have a restriction because I posted a link they thought was an advertisement? I just realized one of my posts got hidden. I was just trying to explain and figure out why a “hello world” test isn’t working. I’m new and trying to figure out things. It was a blank page and if it worked it would have just said, “Hello World”. That’s hardly an advertisement. If I have any more problems, I might have to pick another website. I do appreciate Infinity trying to help me though. Thank you Infinity.

Is your post still hidden?
Anything with URL for new user is hidden by the system automatically until a human checks it I think.

Are you using the php tag on the php pages I assume?

http://e107install.000webhostapp.com/helloworld.php My page uses your code and it displays fine :confused:

The link with the extention “helloworld” isn’t my page and yes, mine ends in .php. My extention is named Hw2.php. I copied and pasted my links directly from my site. ttps://cosies-liver.000webhostapp.com/Hw2.php and ttp://swingcriollo.uphero.com/Hw2.php

Then I went back and deleted the first h from each link.

Do you see anything wrong with my code?

As far as unhiding my material, I think I unhid it by accident by just clicking on links.

https://cosies-liver.000webhostapp.com/Hw2.php
https://swingcriollo.uphero.com/Hw2.php

Don’t work

https://swingcriollo.uphero.com/hlm.html
https://cosies-liver.000webhostapp.com/hlm.html

Do work

Odd.

Do you see anything wrong with my php code?

Not really :confused:

[code]

helloWorld <?php print "

Hello World!

"; ?> [/code]

https://e107install.000webhostapp.com/helloworld.php

https://e107install.000webhostapp.com/worldhello.html

https://e107install.000webhostapp.com/superhello.php