Snukzz Posted October 11, 2004 Report Share Posted October 11, 2004 Kaa dabuut PHP ieksh HTML es zinu, bet kaa dabuut ieksh WML - nezinu gan. Es zinu, ka vaina sintaksee, bet kur?.... nezinu! Un vispaar....WML un PHP darbojas kopaa? :huh: Varbuut kaads var paliidzeet... <?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> <wml> <card> <table> <?php include ('funkcijas.php'); $err=0; $dir=substr('files/',0,-1); if($dh=opendir($dir)){ if(isset($_GET['dir']) && user_num($_GET['dir'])>1){ $dirs=explode(',',user_texc($_GET['dir'],255,255,1,0)); foreach($dirs as $val){ if($val>=2){ $dirs2[]=$val; }else{ $err=1; } } $curdir=($err)?'':implode(',',$dirs2); foreach($dirs2 as $udir){ while(($file=readdir($dh))!==false && $err!=1){ $list[]=$file; } $dir.='/'.$list[user_num($udir)]; if(is_dir($dir)){ $dh=opendir($dir); }else{ $err=1; $dir=''; } unset($list); } } $nos=user_texc(substr($dir,6),50,250,1,0); ?> <TR><TD align="c"><a href="http://snxgsm.from.lv/"><strong>SNX GSM</strong></a><br/><small><u>mobile files</u></small><br/></TD></TR> <TR><TD align="c"><small><?php=($nos=='')?:str_replace('/',' /',$nos) ?></small></TD></TR> <TR><TD align="c"> <?php $i=1; if(is_dir($dir)){ if($dh=opendir($dir)){ while(($file=readdir($dh))!==false){ $listt[]=$file; } arsort($listt,SORT_STRING); $listt=array_reverse($listt,true); reset($listt); foreach($listt as $key => $file){ if(is_dir($dir.'/'.$file) && $file!='.' && $file!='..' && $file!='lost+found'){ echo '<small><A href="?dir=',$curdir.(($curdir)?',':'').$key,'">',$file,'</A><br/></small> '; } } ?> </TD></TR> <TR><TD> <?php reset($listt); foreach($listt as $key => $file){ if(is_file($l=$dir.'/'.$file)){ echo '<strong><small><A href="',$l,'">',$file,'</A></small></strong><br/> '; } } closedir($dh); } } } ?> </TD></TR> <TR><TD align="c"><small>© Snukzz 2004</small></TD></TR> </TABLE> <?php if(isset($dirs[0])){ ?> <?php } ?> </card> </wml> Link to comment Share on other sites More sharing options...
рпр Posted October 11, 2004 Report Share Posted October 11, 2004 (edited) tev serera konfigaa jaanoraada, ka wml faili tisk laisti caur php apacii AddType application/x-httpd-php .wml otrs variants ir rakstīt kā ir un sākumā pielitk header ('Content-Type: text/wml'); Edited October 11, 2004 by рпр Link to comment Share on other sites More sharing options...
neonz Posted October 17, 2004 Report Share Posted October 17, 2004 Problēma ir iekš šīs rindiņas: <?xml version="1.0"?> PHP to uztver kā PHP koda saakumu, bet tur ierauga pēc viņa domām mistisku kodu "xml version...", kas šamam liekas pilnīgi aplams. Aizstāj ar: <?php echo '<?xml version="1.0"?>'; ?> Link to comment Share on other sites More sharing options...
bubu Posted October 17, 2004 Report Share Posted October 17, 2004 neonz, vai ta? Vai tad php nesāk kodu interpretēt tikai pie <? vai <?php direktīvām, bet ne <?xml !!? Link to comment Share on other sites More sharing options...
PheliX Posted October 17, 2004 Report Share Posted October 17, 2004 nu ja ir uzlikc, ka njem arii <? nevis tikai <?php, tad vish ieraugot <?xml to <? saprot jau kaa php saakumu... Link to comment Share on other sites More sharing options...
Recommended Posts