"; ?> in output?

i have a simple test page in XAMPP testing environment…

<?php
echo “<h1>This…</h1>”;
?>

However, the problem is when it outputs echo to browser it adds the "; ?> after “This…”… I’m sure this is a common problem and tried searching forums and google, but didn’t know what key words to use… Please help I need to do some server side testing…

Try to look into page source.
You’ll be surprised :slight_smile:

Then ensure that you have PHP installed, your script has .php extension and you request it as an URL, not a file.

I have isolated the cause as:

I had a contact.html with a form element in it with action=“process.php”… when I call on process.php in URL manually it works no problem and php code is hidden in page source. However, when I call it from contact.html by clicking Submit button that is when php is NOT recognized–I CAN see it in the page source, and the output gets butchered.

I have my contact.html as XHTML strict 1.0 and some Javascript user validation on the form fields, but I don’t get why this is happening. If anyone can help me and has had experience with this thank you very much in advance.

nevermind guys… this is the strangest thing… I walked away and made a cup of tea… came back and it was working all of a sudden? I didnt change a thing! I did close my browser and restart it so maybe it had something to do with way I entered the URL… whatever… thanks anyways again…

oh BTW I did not stop or restart Apache… it was going strong the whole time… very strange indeed…

you’re probably called your contact.html not from web server but from filesystem