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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.