echo not working

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
dre38w
Forum Newbie
Posts: 3
Joined: Thu Dec 22, 2011 2:33 pm

echo not working

Post 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.
phpHappy
Forum Commoner
Posts: 33
Joined: Wed Oct 26, 2011 1:58 pm

Re: echo not working

Post by phpHappy »

it's a php file on a server with php?
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: echo not working

Post 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
dre38w
Forum Newbie
Posts: 3
Joined: Thu Dec 22, 2011 2:33 pm

Re: echo not working

Post 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.
dre38w
Forum Newbie
Posts: 3
Joined: Thu Dec 22, 2011 2:33 pm

Re: echo not working

Post 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.
Post Reply