I am working on a Contact Form in my .php file. I have always worked with loose doctypes, however, today I am using strict. I have my php above my html, and none of the code runs. Instead, it just displays some of the Echos to the page (these aren't even called yet). Also, in my form, I have the following:

<INPUT NAME="Name" SIZE="30" value="<?php echo $Name; ?>">

On the page inside the field, it is displaying: <?php echo $Name; ?>

What is going on here and how can I fix this issue?

Yes, the pages are .php
Here is the doctype:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Any input appreciated

    The fact that you're seeing PHP code has nothing to do with the DOCTYPE declaration (that's HTML, and PHP doesn't care what HTML you're outputting).

    If the PHP code is being displayed in your browser, then something is wrong with your webserver's configuration as it's not calling the PHP interpreter but instead passing .php files along to you as plain text.

      Write a Reply...