Really puzzled on this, probably simple but it is the day after New Years.
I have one line of php 'inline' code that fails to execute on the server before the server sends the page to the browser. Here's the code:
<div>
<a href="http://localhost/myProj/thePhpFile.php"> Server says this: <?php "DOOSH"; ?> </a>
</div>
That's all I have in the body of my html test page. I'm expecting the inline php to put 'DOOSH' there into the html then send the html over the client. Not happening.
All I see in the browser is "Server says this:" and nothing else.
The reason this has me confused is -- I KNOW the php executes on the server BEFORE the html above is sent over, so why is the DOOSH not being sent? I have tried 'DOOSH', "DOOSH", I even tried writing a php function in the file to return "DOOSH" and nothing works -- do I have a syntax problem here?
(NOTE: Doesn't have much to do with my problem here, but I can successfully click on the "Server says this =>" link and I see thePhpFile.php successfully load, as expected.)
<?php $x ?>. If you want the string to be treated as output, you'll have to echo it, exactly as Rich Adams has said in his answer below (which is 100% correct)