Our server costs ~$56 per month to run. Please consider donating or becoming a Patron to help keep the site running. Help us gain new members by following us on Twitter and liking our page on Facebook!
Current time: January 23, 2025, 9:44 pm

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Malware and Threads
#37
RE: Malware and Threads
The purpose of XHTML is to be a reformulation of HTML. You can't just add the XHTML doctype tag into any HTML document and expect it to behave correctly. This is what 99% of developers do, and all it does it make an HTML 4 document with the wrong doctype. But this you know. XML speed is important for more limited devices like smartphones. I'll also point out that it consumes less memory than the same HTML document does. In a way I see HTML 5 as a huge step backwards when we could have simply moved forward with XHTML if people had actually known how to use it. The compatibility issues are far less than with traditional HTML.

Why don't I show you something a little more complicated:
PHP Code:
<?
$uagent=$_SERVER['HTTP_USER_AGENT'];
$httphost='blog.aractus.com';
$base_url='http://'. $httphost. strtok($_SERVER['REQUEST_URI'],'?');
$usehtml=(stripslashes($_SERVER['QUERY_STRING'])=='html');
$usexhtml=(stripslashes($_SERVER['QUERY_STRING'])=='xhtml');
if(!$usehtml && !$usexhtml){
  $usexhtml=stristr($_SERVER['HTTP_ACCEPT'],'application/xhtml+xml');
}
if ($usexhtml) {
  $conttype='application/xhtml+xml';
  $closetag=' />'. chr(10);
  $dtype="<?xml version='1.0' encoding='utf-8'?>". chr(10). '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"'. chr(10). '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
  $htmltg='<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'. chr(10);
  $framesc='<script type="text/javascript" src="/noframes.js" />'. chr(10);
  $popup=' target="_blank"'. chr(10);
  $btarget=' target="_top"';
}
else {
  $usehtml=true;
  $conttype='text/html';
  $closetag='>'. chr(10);
  $dtype='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"'. chr(10). '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
  $htmltg='<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'. chr(10);
  $framesc='<script type="text/javascript" src="/noframes.js"></script>'. chr(10);
  $popup=' target="_blank"'. chr(10);
  $btarget=' target="_top"';
}
header('Content-type: '. $conttype);
?>
<?=$dtypechr(10);?>
<?=$htmltg?>
<head profile="http://gmpg.org/xfn/11">
<?=$framesc?>
// .......
?>
That's what I use to determine if the document is sent as XML or not. And no part of it is plagiarized, FYI. XHTML behaves in different ways to HTML. But the compatibility is so easily managed, I don't think I can ever remember needing to use <!--[if ...]> outside of CSS, and even then only i I'm doing something silly like embedding fonts.

I can change this:
Code:
$conttype='application/xhtml+xml';
To this:
Code:
$conttype='application/xml';
And it will make no difference. Yet if I change it to:
Code:
$conttype='text/html';
All hell breaks loose (the HTML parsing will cease at the self-closing script tag).
Reply



Messages In This Thread
Malware and Threads - by KichigaiNeko - December 18, 2012 at 1:42 am
RE: Malware and Threads - by Annik - December 18, 2012 at 2:12 am
RE: Malware and Threads - by KichigaiNeko - December 18, 2012 at 2:15 am
RE: Malware and Threads - by Annik - December 18, 2012 at 2:16 am
RE: Malware and Threads - by KichigaiNeko - December 18, 2012 at 2:30 am
RE: Malware and Threads - by Aractus - December 18, 2012 at 5:08 am
RE: Malware and Threads - by downbeatplumb - December 18, 2012 at 5:10 am
RE: Malware and Threads - by Annik - December 18, 2012 at 5:20 am
RE: Malware and Threads - by LastPoet - December 18, 2012 at 6:11 am
RE: Malware and Threads - by KichigaiNeko - December 18, 2012 at 6:14 am
RE: Malware and Threads - by Tiberius - December 18, 2012 at 6:30 am
RE: Malware and Threads - by KichigaiNeko - December 18, 2012 at 6:36 am
RE: Malware and Threads - by Tiberius - December 18, 2012 at 6:41 am
RE: Malware and Threads - by KichigaiNeko - December 18, 2012 at 7:17 am
RE: Malware and Threads - by LastPoet - December 18, 2012 at 6:34 am
RE: Malware and Threads - by Aractus - December 18, 2012 at 6:44 am
RE: Malware and Threads - by Tiberius - December 18, 2012 at 6:50 am
RE: Malware and Threads - by LastPoet - December 18, 2012 at 6:59 am
RE: Malware and Threads - by Tiberius - December 18, 2012 at 7:15 am
RE: Malware and Threads - by LastPoet - December 18, 2012 at 7:20 am
RE: Malware and Threads - by Aractus - December 18, 2012 at 7:44 am
RE: Malware and Threads - by LastPoet - December 18, 2012 at 7:57 am
RE: Malware and Threads - by Aractus - December 18, 2012 at 8:17 am
RE: Malware and Threads - by LastPoet - December 18, 2012 at 8:18 am
RE: Malware and Threads - by Tiberius - December 18, 2012 at 8:25 am
RE: Malware and Threads - by Aractus - December 18, 2012 at 9:09 am
RE: Malware and Threads - by Tiberius - December 18, 2012 at 9:22 am
RE: Malware and Threads - by LastPoet - December 18, 2012 at 9:15 am
RE: Malware and Threads - by Aractus - December 18, 2012 at 9:34 am
RE: Malware and Threads - by LastPoet - December 18, 2012 at 9:38 am
RE: Malware and Threads - by KichigaiNeko - December 18, 2012 at 9:44 am
RE: Malware and Threads - by LastPoet - December 18, 2012 at 9:48 am
RE: Malware and Threads - by KichigaiNeko - December 18, 2012 at 9:51 am
RE: Malware and Threads - by LastPoet - December 18, 2012 at 10:03 am
RE: Malware and Threads - by LastPoet - December 18, 2012 at 9:45 am
RE: Malware and Threads - by Tiberius - December 18, 2012 at 9:46 am
RE: Malware and Threads - by Aractus - December 18, 2012 at 10:05 am
RE: Malware and Threads - by LastPoet - December 18, 2012 at 10:17 am
RE: Malware and Threads - by Tiberius - December 18, 2012 at 10:31 am
RE: Malware and Threads - by Aractus - December 18, 2012 at 10:44 am
RE: Malware and Threads - by LastPoet - December 18, 2012 at 10:53 am
RE: Malware and Threads - by Tiberius - December 18, 2012 at 10:53 am
RE: Malware and Threads - by Aractus - December 18, 2012 at 10:58 am
RE: Malware and Threads - by Tiberius - December 18, 2012 at 11:02 am
RE: Malware and Threads - by Aractus - December 19, 2012 at 3:26 am
RE: Malware and Threads - by Waratah - December 19, 2012 at 5:50 am
RE: Malware and Threads - by thesummerqueen - December 18, 2012 at 4:00 pm
RE: Malware and Threads - by Minimalist - December 18, 2012 at 4:27 pm
RE: Malware and Threads - by Jaysyn - December 18, 2012 at 8:23 pm
RE: Malware and Threads - by Forsaken - December 18, 2012 at 8:44 pm
RE: Malware and Threads - by Tiberius - December 18, 2012 at 9:20 pm
RE: Malware and Threads - by Forsaken - December 19, 2012 at 6:56 pm
RE: Malware and Threads - by Tiberius - December 19, 2012 at 8:34 pm
RE: Malware and Threads - by Forsaken - December 20, 2012 at 4:18 am
RE: Malware and Threads - by Angrboda - December 19, 2012 at 11:12 pm

Possibly Related Threads...
Thread Author Replies Views Last Post
  Suggestion: Install Soma Tablet Depositories On All Threads Violet 17 3346 May 3, 2020 at 1:14 pm
Last Post: Rhizomorph13
Information [Serious] Why can't I subscribe to threads? CaenLeranzo 6 1877 February 25, 2020 at 4:53 pm
Last Post: BrianSoddingBoru4
  Civil/ safe option for threads. Mystic 2 1224 November 19, 2018 at 10:25 pm
Last Post: SteelCurtain
  I know I'm not supposed to revive really old threads, so... Martian Mermaid 23 5617 November 22, 2017 at 9:45 am
Last Post: I_am_not_mafia
  Alternative to "click bait" rule: block threads robvalue 40 7580 February 6, 2017 at 1:38 am
Last Post: rexbeccarox
  Mafia game threads showing in "Today's Posts" lists Ravenshire 18 7375 February 5, 2017 at 4:53 pm
Last Post: Ravenshire
  Missing drafts (threads, not PMs) Aroura 13 2454 December 2, 2016 at 9:06 pm
Last Post: Aroura
  Necroing of threads by newbies Joods 11 2115 July 4, 2016 at 7:26 pm
Last Post: Whateverist
  Suggestion/question: breadcrumb nav at the bottom of threads? KevinM1 17 3635 November 10, 2015 at 4:48 pm
Last Post: KevinM1
  Starting Threads with Links rexbeccarox 17 4194 October 6, 2015 at 5:16 pm
Last Post: Edwardo Piet



Users browsing this thread: 11 Guest(s)