Jump to content

Very basic php problem


haaki

Recommended Posts

I started learning php for the first time today, but I did not get further than my first "Hello World!", before the problems started.

 

<?php
echo "<h1>Hello World!</h1>";
?>

 

Gives this screen:

 

first.jpg

 

My question: Why is the ;?> displayed?

 

Is it a bad installation of php or apache? It displays correctly when I upload it to my host and display it "online": http://www.hakonkavli.com/first.php

 

Can someone guide me to the solution of this problem?

 

Thank you very much!

 

Edit: Oh, by the way: To test my php and apache install I created a file phpinfo.php with the code:

 

<?php
phpinfo();
?>

 

It shows up correctly when I go to http://localhost/phpinfo.php, but is blank when I open the file from c:

 

I don't know if it matters to the problem solution, but I thought it might be relevant.

Link to comment
https://forums.phpfreaks.com/topic/161011-very-basic-php-problem/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.