can i put same coding (wml and xhtml ) in one index.php file? i meant if any one log with a browser wich support xhtml he is redirected to xhtml part of that index.php file otherwise he is directed to wml part in dat same index.php file... could u plz post here an exaple file if possible? thanx in advance
Wml And Xhtml In Same Index.php
Collapse
X
-
greezTags: None
-
can i put same coding (wml and xhtml ) in one index.php file? i meant if any one log with a browser wich support xhtml he is redirected to xhtml part of that index.php file otherwise he is directed to wml part in dat same index.php file... could u plz post here an exaple file if possible? thanx in advance[/b]
there are many different ways u can do this. try this.Attached Files
-
greez
thanx wizard but this is not wat i meant, i meant in one index.php, can make xhtml codes and wml codes?there are many different ways u can do this. try this.[/b]
ex
if($site=="wap"){
and
if($site=="html"){
Comment
-
Guest
wizard, that is a pretty useful script
thanks!
...
-----------------------------------------------------
hey dude thats the exact script for you to use, just read the script properly, you will understad.this is the body.inc.php. u can use this thing and get this working with your any type of script.Code:<?PHP include_once("includes/sources/device.inc.php"); class Body { var $Body = ''; function header() { $Device = new Device; if($Device->Device == 'wml') { header("Content-type: text/vnd.wap.wml; charset=utf-8"); header("Cache-Control: no-store, no-cache, must-revalidate"); } if($Device->Device == 'xhtml') { header("Content-type: application/xhtml+xml; charset=utf-8"); header("Cache-Control: no-store, no-cache, must-revalidate"); } if($Device->Device == 'html') { header("Content-type: text/html; charset=utf-8"); header("Cache-Control: no-store, no-cache, must-revalidate"); } } function start_page() { $Device = new Device; if($Device->Device == 'wml') { $this->Body .= '<?xml version="1.0" encoding="UTF-8"?>'; $this->Body .= "\n"; $this->Body .= '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml12.dtd">'; $this->Body .= "\n"; } if($Device->Device == 'xhtml') { $this->Body .= '<?xml version="1.0" encoding="UTF-8"?>'; $this->Body .= "\n"; $this->Body .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'; $this->Body .= "\n"; } if($Device->Device == 'html') { $this->Body .= '<?xml version="1.0" encoding="UTF-8"?>'; $this->Body .= "\n"; $this->Body .= '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'; $this->Body .= "\n"; } } function pghead($title) { $Device = new Device; if($Device->Device == 'wml') { $this->Body .= '<wml>'; $this->Body .= "\n"; $this->Body .= '<card id="index" title="'.$title.'">'; $this->Body .= "\n"; } if($Device->Device == 'xhtml') { $this->Body .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >'; $this->Body .= "\n"; $this->Body .= '<head>'; $this->Body .= "\n"; $this->Body .= '<title>'.$title.'</title>'; $this->Body .= "\n"; $this->Body .= '</head>'; $this->Body .= "\n"; $this->Body .= '<body>'; $this->Body .= "\n"; } if($Device->Device == 'html') { $this->Body .= '<html>'; $this->Body .= "\n"; $this->Body .= '<head>'; $this->Body .= "\n"; $this->Body .= '<title>'.$title.'</title>'; $this->Body .= "\n"; $this->Body .= '</head>'; $this->Body .= "\n"; $this->Body .= '<body>'; $this->Body .= "\n"; } } function pgfoot() { $Device = new Device; if($Device->Device == 'wml') { $this->Body .= '</card></wml>'; } if($Device->Device == 'xhtml') { $this->Body .= '</body></html>'; } if($Device->Device == 'html') { $this->Body .= '</body></html>'; } } function show_Body() { echo $this->Body; } } ?>
Comment
-
Guest
awesome wizard
i think we can also use the codes of personal wap sites in lava script. it has both xhtml and wml in same page. and simple to use.
Comment

Comment