Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP is displayed to page because Doctype = Strict
Old 11-27-2010, 10:35 PM PHP is displayed to page because Doctype = Strict
Skilled Talker

Posts: 83
Trades: 0
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
Smudly is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-28-2010, 12:48 AM Re: PHP is displayed to page because Doctype = Strict
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
PHP is entirely unaware of what format its output is in; it doesn't matter what doctype, markup, language, or format. In other words, using a certain doctype should have absolutely no affect on PHP.

If unparsed code is being displayed in the browser then your code isn't being parsed by PHP. From the information you posted I have no idea why, but I am 100% sure it is not because of the doctype.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 11-28-2010, 06:08 PM Re: PHP is displayed to page because Doctype = Strict
Defies a Status

Posts: 1,606
Trades: 0
If you are using notepad or even one of the better editors and failed to select to correct file type it may have been saved filename.php.txt which would then render without processing. BTDT more than once.
__________________
Colbyt

Please login or register to view this content. Registration is FREE
colbyt is offline
Reply With Quote
View Public Profile
 
Old 11-28-2010, 07:45 PM Re: PHP is displayed to page because Doctype = Strict
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
If it isn't a file extension issue, speak to your sys admin or hosting company urgently! Move any library or header files containing sensitive values immediately until the problem is fixed.
PaulW is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP is displayed to page because Doctype = Strict
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21919 seconds with 12 queries