Problem with "echo" Solved!!!

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Problem with "echo" Solved!!!

Postby mitrasg » 15. February 2009 03:51

Hello! I'm new to php. Can someone solve this problem please!

When I save the code below with .php extention and run in firefox a blank page results

<? php
echo "I love using PHP!";
?>

When I run this code

<? php
echo "<p>I love using PHP!</p>";
?>

in firefox, the result is

I love using PHP!

"; ?>

How can I solve this problem? Entire php code after 'echo' get printed.
How can I prevent printing the unnecessary parts?
My OS is Vista Ultimate. I'm using XAMPP 1.7.0
Last edited by mitrasg on 15. February 2009 05:19, edited 1 time in total.
mitrasg
 
Posts: 3
Joined: 15. February 2009 03:30

Re: Problem with "echo"

Postby Izzy » 15. February 2009 04:25

mitrasg wrote:How can I prevent printing the unnecessary parts?
Try some reading here
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Problem with "echo"

Postby mitrasg » 15. February 2009 05:19

Hi!

I figured it out. The php file( I named it Echo.php) should be saved in htdocs and browsed giving http://localhost/Echo.php.
By double clicking the file to open, the error page results.

Any way thanks for the help Izzy :D .

With regards,
Mitra
mitrasg
 
Posts: 3
Joined: 15. February 2009 03:30

Re: Problem with "echo" Solved!!!

Postby Izzy » 15. February 2009 05:40

Your welcome and thanks for posting back with your solution - yes, the server has to parse php code.

Best wishes Mitra and now enjoy your XAMPP experience.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 179 guests