tags:

views:

44

answers:

2

Hi 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>
+4  A: 

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/

Lekensteyn
@Lekensteyn:as i'm a beginner forgive me for my question, can i use xampp as my server?
tintincute
ok cool I have it already, i would like to know how to use it?
tintincute
If you've installed XAMPP in C:\xampp, put your files in `C:\xampp\htdocs`. Example: `C:\xampp\htdocs\file.php` is accessible with `http://localhost/file.php`
Lekensteyn
+1  A: 

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

steve
i'm using xampp, what does it mean virtual webserver? i would like to know how to use this with my xampp, using windows 7
tintincute
That's not a *virtual* webserver, but a webserver. Using `print` instead of `echo` won't solve the problem.
Lekensteyn