Jump to content
php.lv forumi

Kaa ir pareizi?


Snukzz

Recommended Posts

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

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 by рпр
Link to comment
Share on other sites

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

×
×
  • Create New...