Page 1 of 1

echo not working

Posted: Thu Dec 22, 2011 2:38 pm
by dre38w
echo will not print out a value. I do the simple string " " and it doesn't even do that. It's just blank in my browser. I use netbeans and firefox and chrome. Any idea as to what I'm doing wrong? Simple code snippet:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>PHP Testing</title>
</head>
<body>
<?php
echo "print me";
?>
</body>
</html>

Thanks for any future help.

Re: echo not working

Posted: Thu Dec 22, 2011 3:05 pm
by phpHappy
it's a php file on a server with php?

Re: echo not working

Posted: Thu Dec 22, 2011 3:18 pm
by twinedev
To determine if it is processing PHP, when you view the page, hit CTRL-U to see the source. If you actually see the <?php ... ?> code then it is not a .php file or the server is not set up for it. Never just go off of what you "see" in the browser, remember the source of the page is the actual output.

-Greg

Re: echo not working

Posted: Thu Dec 22, 2011 3:21 pm
by dre38w
I think what's happened is I don't have a local host set up. I'm installing xampp to see if that solves the problem. Thank you for your replies.

Re: echo not working

Posted: Sat Dec 24, 2011 1:51 pm
by dre38w
I installed xampp and had to put my projects in the htdocs folder and change a few settings and it worked. A co-worker helped with the final touches of this problem. Sorry I didn't reply to this. I needed a quick answer so I posted on a few forums at once and another forum was helping but I thank you all.