php header/html DTD issues?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fairyprincess18
Forum Newbie
Posts: 21
Joined: Sun Dec 07, 2008 8:54 pm

php header/html DTD issues?

Post by fairyprincess18 »

whenever i try to include this small php script before my html DTD, it breaks some of the javascript functionality on my page.

the php script is:

Code: Select all

 
<?php
    require_once('d:\pieces\wnusers\wnuser.class.php');
    $user = new wnuser();
    if (!$user->valid) { // check whether user/pass combo worked
        header('Location: index.php?err=bad_login');
        exit();
    }
?>
 
my guess is that including this doesnt work due to conflict with my html DTD definition as follows:

Code: Select all

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 
anyone know why?
User avatar
akuji36
Forum Contributor
Posts: 190
Joined: Tue Oct 14, 2008 9:53 am
Location: Hartford, Connecticut

Re: php header/html DTD issues?

Post by akuji36 »

try

the transitional doctype
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: php header/html DTD issues?

Post by mikemike »

Remove the whitespace, and shouldn't it be:

Code: Select all

require_once('d:\\pieces\\wnusers\\wnuser.class.php');
Or am I living in the dark ages? (I've not used a Windows machine for years)
Post Reply