Page 1 of 1

php header/html DTD issues?

Posted: Tue Apr 07, 2009 2:43 pm
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?

Re: php header/html DTD issues?

Posted: Sat Jun 06, 2009 10:12 am
by akuji36
try

the transitional doctype

Re: php header/html DTD issues?

Posted: Sat Jun 06, 2009 10:15 am
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)