echo doesn't work

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
junjustkim
Forum Commoner
Posts: 44
Joined: Thu May 22, 2008 8:48 pm

echo doesn't work

Post by junjustkim »

:P
hi to all

I am newbie with php. I am using cs3 dreamweber and xampp as my server localhost. Inside dreamweber I created index.php and save it in xampp/localhost/test1. The problem is when I run the code there is no any result in my browser. I am using mozilla firefox. Actually I am following step by step with the tutorial. I test my code even using variable and output the result using echo but it doesn't work. I don't know if there is a problem with my xampp or dreamweber. Please help me I am very interested in web development.

Thanks in advance

Code: Select all

 
<html>
<body>
<?php
echo "Hello World";
?>
</body>
</html>
 
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: echo doesn't work

Post by califdon »

junjustkim wrote::P
hi to all

I am newbie with php. I am using cs3 dreamweber and xampp as my server localhost. Inside dreamweber I created index.php and save it in xampp/localhost/test1. The problem is when I run the code there is no any result in my browser. I am using mozilla firefox. Actually I am following step by step with the tutorial. I test my code even using variable and output the result using echo but it doesn't work. I don't know if there is a problem with my xampp or dreamweber. Please help me I am very interested in web development.

Thanks in advance

Code: Select all

 
<html>
<body>
<?php
echo "Hello World";
?>
</body>
</html>
 
Did you name your file just test1? You must give it a file extension of .php in order for Apache web server to recognize that it needs to send it to PHP for preprocessing.
junjustkim
Forum Commoner
Posts: 44
Joined: Thu May 22, 2008 8:48 pm

Re: echo doesn't work

Post by junjustkim »

thanks for your immediate replied. test1 is my folder but the name is index.php

My folder structure is like this:

xampp/localhost/test1/index.php

on my browser I was type localhost/test1/index.php

the browser displayed but no result appeared but if I put another string using <p> hello world <p> it was displayed but the one using echo doesn't

Thanks
mhonnphp
Forum Commoner
Posts: 37
Joined: Fri Oct 12, 2007 11:29 pm
Location: Philippines
Contact:

Re: echo doesn't work

Post by mhonnphp »

junjustkim wrote: thanks for your immediate replied. test1 is my folder but the name is index.php

My folder structure is like this:

xampp/localhost/test1/index.php

on my browser I was type localhost/test1/index.php

the browser displayed but no result appeared but if I put another string using <p> hello world <p> it was displayed but the one using echo doesn't

Thanks

hmm... maybe you type your codes at the DESIGN VIEW!?
switch to CODE VIEW.

CS3
View MENU -> CODE

type :

<?php

echo "HELLO WORLD";

?>

then save with the extension name .php
ex. sample.php

then try to view your page again.
timsewell
Forum Newbie
Posts: 21
Joined: Tue Feb 26, 2008 5:43 am
Location: Hove, England

Re: echo doesn't work

Post by timsewell »

Also, and I presume this is common to all XAMMP installations, I believe files need to be in the directory \htdocs, which is the web root, to be viewable in a browser through the http://localhost/ domain.
User avatar
panic!
Forum Regular
Posts: 516
Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK

Re: echo doesn't work

Post by panic! »

when you view the page, what happens? do you literally see

'<?php
echo "Hello World";
?>'

In the browser? if so you need to change where you see < into < and > to > in your source and in future develop in code mode, maybe find a better environment for developing your code than dreamweaver.

if not, try viewing the source and paste us what you see.
junjustkim
Forum Commoner
Posts: 44
Joined: Thu May 22, 2008 8:48 pm

Re: echo doesn't work

Post by junjustkim »

Thank you to all of you, actually I already solved my problem a while ago. The problem is to my browser mozilla firefox because I tried to open it in IE and it worked it out. I don't know if i have to modify the settings of my firefox.

Hi panic! what would you suggest best environment for developing web using php.

Again thank you so much to all of your best effort.

tirso
User avatar
panic!
Forum Regular
Posts: 516
Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK

Re: echo doesn't work

Post by panic! »

Hi,

I personally use Coda for Mac, some other people I work with use TextMate.

I don't know about Windows development apps. Maybe you could make a thread asking for opinions.
junjustkim
Forum Commoner
Posts: 44
Joined: Thu May 22, 2008 8:48 pm

Re: echo doesn't work

Post by junjustkim »

Thanks for your replied
Post Reply