Splitti Posted November 19, 2010 Share Posted November 19, 2010 Hi all This is my first post on this forum, so i hope i follow the rules proberly Well i got this index.php where i got a Doctype in it : ( <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> ) and here is my problem, when i include another php file then the doctype dont work on that php file, (The doctype should show the Danish charecters, ÆØÅ - æøå and it dont, after a include.) why is that ?? and what can i do ?? Quote Link to comment https://forums.phpfreaks.com/topic/219219-doctype-dosent-work-after-include/ Share on other sites More sharing options...
johnsmith153 Posted November 19, 2010 Share Posted November 19, 2010 Could be anything, but make sure you're outputing the doctype to the browser. You can't just dump HTML onto a .php file and hope it displays. Ensure you do this: echo " doctype etc. "; If not, you'll have to give us some more info. Quote Link to comment https://forums.phpfreaks.com/topic/219219-doctype-dosent-work-after-include/#findComment-1136807 Share on other sites More sharing options...
PFMaBiSmAd Posted November 19, 2010 Share Posted November 19, 2010 Cannot really help you with the specific problem you are having unless you post enough code that reproduces the problem. There are literally a dozen different things that could be causing the symptom and you have got to show what you are doing in order to narrow down that list. Quote Link to comment https://forums.phpfreaks.com/topic/219219-doctype-dosent-work-after-include/#findComment-1136809 Share on other sites More sharing options...
Splitti Posted November 19, 2010 Author Share Posted November 19, 2010 Yes i know that i cant dump html into a php code, but that is not the poblem. My problem is that the doctype works on my index page but if i include 'something.php'; into my index page, then the doctype dont work on the included page. My index.php ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <? include 'www/indhold.php'; <--------- On this page dosent the doctype work. ?> </body> </html> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- why is that ?? and what can i do ?? Quote Link to comment https://forums.phpfreaks.com/topic/219219-doctype-dosent-work-after-include/#findComment-1136812 Share on other sites More sharing options...
AbraCadaver Posted November 19, 2010 Share Posted November 19, 2010 Nothing to do with doctype. You need charset="UTF-8". Try that and if you have problems post the index and the include. Quote Link to comment https://forums.phpfreaks.com/topic/219219-doctype-dosent-work-after-include/#findComment-1136813 Share on other sites More sharing options...
johnsmith153 Posted November 19, 2010 Share Posted November 19, 2010 Always use <?php rather than <? (not sure if it will help, but worth a go). Quote Link to comment https://forums.phpfreaks.com/topic/219219-doctype-dosent-work-after-include/#findComment-1136815 Share on other sites More sharing options...
Splitti Posted November 19, 2010 Author Share Posted November 19, 2010 Okay, heres my index.php ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <? include 'www/indhold.php'; <--------- On this page dosent the doctype work. ?> </body> </html> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- here is the included file. that dont show the danish charecters ÆØÅ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- <div> Some text with ÆØÅ danish charrecter æøå </div> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Quote Link to comment https://forums.phpfreaks.com/topic/219219-doctype-dosent-work-after-include/#findComment-1136817 Share on other sites More sharing options...
Splitti Posted November 19, 2010 Author Share Posted November 19, 2010 You guys need more info, could really use some help on this one Quote Link to comment https://forums.phpfreaks.com/topic/219219-doctype-dosent-work-after-include/#findComment-1136860 Share on other sites More sharing options...
LuRKeR Posted November 19, 2010 Share Posted November 19, 2010 Try this page format <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php include("http://www.link.com/"); ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/219219-doctype-dosent-work-after-include/#findComment-1136868 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.