hey guys, ima php newb here so be kind lol
any idea what went wrong here?
basically i just want it to display the different thing for whether the variable .php?type=wml or .php?type=xhtml (carried in the url from the previous page [sorted, no problems with that])
when i run the xhtml output throuhg the w3c validator, it's okay, but i then get this from the wml output
-*-
i've tried a few things, including using this instead
but it simply gives the error:
any help guys?
any idea what went wrong here?
basically i just want it to display the different thing for whether the variable .php?type=wml or .php?type=xhtml (carried in the url from the previous page [sorted, no problems with that])
Code:
<?php $xhtml="<?xml version=\"1.0\" encoding=\"UTF-8\"?> <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> <html> <head> <title>test xhtml page</title> </head> <body> <p align=\"center\"> test xhtml page </p> </body> </html>"; $wml="<?xml version=\"1.0\" encoding=\"UTF-8\"?> <!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\"> <wml> <card id=\"c1\" title=\"test wml page\"> <p align=\"center\"> test wml page </p> </card> </wml>"; if($type == xhtml) echo $xhtml; else echo $wml; ?>
when i run the xhtml output throuhg the w3c validator, it's okay, but i then get this from the wml output
Result: Failed validation, 0 error
Unknown Parse Mode!
The MIME Media Type (text/html) for this document is used to serve both SGML and XML based documents, and it is not possible to disambiguate it based on the DOCTYPE Declaration in your document. Parsing will continue in SGML mode.
This page is not Valid -//WAPFORUM//DTD WML 1.1//EN![/b]
Unknown Parse Mode!
The MIME Media Type (text/html) for this document is used to serve both SGML and XML based documents, and it is not possible to disambiguate it based on the DOCTYPE Declaration in your document. Parsing will continue in SGML mode.
This page is not Valid -//WAPFORUM//DTD WML 1.1//EN![/b]
i've tried a few things, including using this instead
Code:
if($type == xhtml) echo $xhtml; elseif($type == wml) echo $wml; else { $xhtmlredirect = "/index2.php?type=xhtml"; $wmlredirect = "/index2.php?type=wml"; if(strpos(strtoupper($HTTP_ACCEPT),"VND.WAP.WML") > 0){ header("Location: ".$wmlredirect);} else{ header("Location: ".$xhtmlredirect); exit; } ?>
Parse error: parse error, unexpected $ in /home/wwwfant/public_html/kwah/index2.php on line 57[/b]
Comment