Jump to content

PHP is displayed to page because Doctype = Strict


Smudly

Recommended Posts

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

Php is a server side scripting language. The doc type has nothing to do with php. Only the browser cares about the doc type.

 

If your php code is not being parsed and executed on the server it means that something is preventing the server from seeing the php code as php code.

 

You are either NOT using a .php extension on the file or you didn't browse to the file using a URL in your browser's address bar or you put the file into a location where the php language is disabled on your server...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.