tintincutes
tintincutes

Reputation: 5796

php in html, some part of code is not displaying

I would like to learn PHP and started reading this info's in the website: And I have question about this code:

Why is this line not displaying? " echo 'Neo: I am Neo, but my people call me The One.';"

Thanks

  <html>
  <head></head>
  <body>

  Agent: So who do you think you are, anyhow?
  <br />

  <?php
  // print output
  echo 'Neo: I am Neo, but my people call me The One.';
  ?>

  </body>
  </html>

Upvotes: 0

Views: 157

Answers (2)

steve
steve

Reputation: 13

Make sure you are using a virtual webserver such as mamp or xampp, Also try print instead of echo with "

Upvotes: 1

Lekensteyn
Lekensteyn

Reputation: 66515

You need a webserver, and give it a .php extension. You cannot run it directly from your drive (e.g. /home/user/file.php or C:\file.php), you must run it from your server (e.g. http://localhost/file.php or http://example.com/file.php)

A webserver can be downloaded from http://www.xampp.org/

Upvotes: 4

Related Questions