Help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help

    plz fix this error,when im using the index.php given below the opera 9.10 brower says


    XML parsing failed: syntax error (Line: 3, Character: 0)

    Reparse document as HTML
    Error:missing root element
    Specification:http://www.w3.org/TR/REC-xml/
    1: <?xml version="1.0"?>
    2: <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">









    index.php



    Code:
    <?php
    ini_set (&#39;display_errors&#39;, 0);
    ob_start("ob_gzhandler");
    header("Content-type: text/vnd.wap.wml");
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-cache, must-revalidate");
    header("Pragma: no-cache");
    header("Provided-by: [email]ngeo@ngeo.ro[/email] "); 
    echo "<?xml version=\"1.0\"?> 
    <!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
    ." \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n";  
    session_save_path(&#39;tmp&#39;);
    ini_set("session.gc_maxlifetime","300");
    ini_set("session.gc_probability","1");
    ini_set("session.gc_divisor","30000");
    ini_set("session_cache_limiter", "nocache");
    ini_set(&#39;session.name&#39;, &#39;sess&#39;);
    session_start();
    $sess=session_id();
    $name = substr($sess, 29, 3);
    $today = date("H:i");
    $now = time();
    ////////////////////////////START CONFIGURAION ZONE///////////////////////////
    ///////////////////SET SIZE OF CHAT PAGE. SMALL SIZE MATTERS//////////////////
    $content_size = "800";  
    ///////////////////SET TERMS AND CONDITIONS, ABOUT, EMAIL, ETC////////////////
    $terms ="this is a free zone, one room is available and the nickname&#39;s are automatically generated.";  
    ////////////////////////////END CONFIGURAION ZONE/////////////////////////////
    $adress = $_SERVER[&#39;SCRIPT_NAME&#39;];
    
    
    if(!isset($_GET[&#39;type&#39;])) $_GET[&#39;type&#39;] = &#39;&#39;;
    
    switch($_GET[&#39;type&#39;]) {
        
    case &#39;&#39;: 
    ?>
    <wml>
    <card id="ngeo" title="ngeo chat">
    <p align="center">[img]img/logo.gif[/img]
    
    
    </p>
    <p align="center"><big>[b]welcome to 
    ngeo mobile chat
    
    [/b]</big></p>
    <p align="left">            
    <a href ="index.php?type=chat&amp;nocache_time=<?php echo $now;?>">enter</a>
    </p>
    <p align="center">            
    <a href ="index.php?type=terms&amp;nocache_time=<?php echo $now;?>">terms</a>
    </p>
    </card>
    </wml>
    <?php
    break;
        
    case &#39;set&#39;: 
    
    
    ?>
    <wml>
    <card id="ngeo" title="ngeo chat" newcontext="true">
    
    <p align="left">            
               [b]message:[/b]
    
      
        <input name="message" size="20" maxlength="250" value="" emptyok="true"/>
    
    
        <anchor>write
                <go href="index.php?type=write&amp;nocache_time=<?php echo $now;?>" method="post">
                 <postfield name="message" value="$(message)"/>
                </go>
       </anchor>
    </p>
    
    <?php
    $filename = &#39;chat.txt&#39;;
    $somecontent  =" ";
        if (is_writable($filename)) { 
        if (!$handle = fopen($filename, &#39;a&#39;)) {  
             echo "<p align=\"center\"><img src=\"img/attention.gif\" alt=\"!\"/></p>";
             echo "
    
    cannot open file chat.txt! create and set chmod: 0777</p>"; 
             exit;
        }
    
       
        if (!fwrite($handle, $somecontent)) {
             echo "<p align=\"center\"><img src=\"img/attention.gif\" alt=\"!\"/></p>";
             echo "
    
    cannot write to chat.txt! create and set chmod: 0777</p>"; 
             exit;
        }        
        } 
         else {
         echo "<p align=\"center\"><img src=\"img/attention.gif\" alt=\"!\"/></p>";
         echo "
    
    the chat.txt is not writable! set chmod: 0777</p>";
        }
    ?>
    </card>
    </wml>
    <?php
    break;
    
    
    case &#39;write&#39;:
    ?>
    <wml>
    <card id="ngeo" title="ngeo chat">
    <?php
    $filename = &#39;chat.txt&#39;;
    
    chmod("$filename", 0777);
    
    $dataneeds ="1";
    $datapost = htmlspecialchars($_POST[&#39;message&#39;]);
    
    if ($datapost < $dataneeds)
    {
    echo "<p align=\"center\"><img src=\"img/attention.gif\" alt=\"!\"/></p>";
    echo "
    
    write more than one character!</p>";
    echo "
    
    <a href =\"index.php?type=set&amp;nocache_time=$now\">return</a></p>";  
    }
    else
    {
    $somecontent  ="<img src=\"img/dot.gif\" alt=\"*\"/> user_[b]$name[/b] ($today): [b]";
    $somecontent .=htmlspecialchars($_POST[&#39;message&#39;]); 
    $somecontent .="[/b]"; 
    $somecontent .="
    ";
    
    if (is_writable($filename)) {
    
      
        if (!$handle = fopen($filename, &#39;a&#39;)) {
             echo "<p align=\"center\"><img src=\"img/attention.gif\" alt=\"!\"/></p>";
             echo "
    
    cannot open file chat.txt! create and set chmod: 0777</p>"; 
             exit;
        }
    
       
        if (!fwrite($handle, $somecontent)) {
             echo "<p align=\"center\"><img src=\"img/attention.gif\" alt=\"!\"/></p>";
             echo "
    
    cannot write to chat.txt! create and set chmod: 0777</p>";
             exit;
        }        
        } 
    else {
          echo "<p align=\"center\"><img src=\"img/attention.gif\" alt=\"!\"/></p>";
          echo "
    
    the chat.txt is not writable! set chmod: 0777</p>";
         }
    header("Location: $adress?type=chat&nocache_time=$now"); 
    }
    
    
    
    
    
    ?>
    
    
    
    
    </card>
    </wml>
    <?php
    break;
    
    
    case &#39;create&#39;:
    ?>
    <wml>
    <card id="ngeo" title="ngeo chat">
    <?php
    function create($file="")
    {
    global $file_;
    if(trim($file_)=="")
    $file_="chat.txt";
    if(trim($file)=="")
    $file=basename($_SERVER[&#39;PHP_SELF&#39;]);
    if(!file_exists($file_))
    {
    if(!fopen($file_,"w"))
    {
    echo "<p align=\"center\"><img src=\"img/attention.gif\" alt=\"!\"/></p>";
    echo "

    cannot create chat.txt! create and set chmod: 0777</p>";
    return;
    }
    }
    }
    header("Location: $adress?type=set&nocache_time=$now");
    echo create();
    chmod("chat.txt", 0777);
    ?>
    </card>
    </wml>
    <?php
    break;

    case &#39;delete&#39;:
    ?>
    <wml>
    <card id="ngeo" title="ngeo chat">

    <?php
    $filename ="chat.txt";

    if (file_exists($filename)) {

    unlink($filename);
    header("Location: $adress?type=create&nocache_time=$now");

    } else {
    header("Location: $adress?type=set&nocache_time=$now");
    }
    ?>
    </card>
    </wml>

    <?php
    break;
    case &#39;chat&#39;;

    ?>
    <wml>
    <card id="ngeo" title="ngeo chat" ontimer="<?php echo "index.php?type=chat&amp;nocache_time=$now" ?>">
    <timer value="200"/>
    <?php
    $filename = "chat.txt";
    $handle = fopen($filename, "r");
    $contents = fread($handle, filesize($filename));
    if (filesize($filename) > $content_size)
    {

    echo "<p align=\"left\">you are: user_$name

    <a href =\"index.php?type=delete&amp;nocache_time=$now\">w rite</a>
    <a href =\"index.php?type=chat&amp;nocache_time=$now\">ref resh</a>
    </p>";

    }
    else
    {

    echo "<p align=\"left\">you are: user_$name

    <a href =\"index.php?type=set&amp;nocache_time=$now\">writ e</a>
    <a href =\"index.php?type=chat&amp;nocache_time=$now\">ref resh</a>
    </p>";

    }

    echo "

    $contents</p>";

    if (filesize($filename) > $content_size)
    {

    echo "<p align=\"left\">
    <a href =\"index.php?type=delete&amp;nocache_time=$now\">w rite</a>
    <a href =\"index.php?type=chat&amp;nocache_time=$now\">ref resh</a>
    </p>";

    }
    else
    {

    echo "<p align=\"left\">
    <a href =\"index.php?type=set&amp;nocache_time=$now\">writ e</a>
    <a href =\"index.php?type=chat&amp;nocache_time=$now\">ref resh</a>
    <a href =\"index.php?type=out&amp;nocache_time=$now\">ou t</a>
    </p>";

    }

    fclose($handle);
    ?>
    </card>
    </wml>

    <?php
    break;
    case &#39;out&#39;;
    ?>
    <wml>
    <card id="ngeo" title="ngeo chat">
    <?php
    session_destroy();
    header("Location: $adress");
    ?>
    </card>
    </wml>

    <?php
    break;
    case &#39;terms&#39;;
    ?>
    <wml>
    <card id="ngeo" title="ngeo chat">
    <p align="center">[img]img/logo.gif[/img]


    </p>
    <?php
    echo "

    $terms</p>";
    ?>
    <p align="left">
    <a href ="index.php">back</a>
    </p>
    </card>
    </wml>
    <?php
    }

    ?>

    #2
    What ya site addy ?
    Want something coded email me at sales@webnwaphost.com for a prices.




    Comment


      #3
      what site you have?

      i dont see the error, with opera 9.10
      http://www.ngeo.ro/test/test3/chat/index.php
      http://ngeo.ro

      Comment


        #4
        what site you have?

        i dont see the error, with opera 9.10
        http://www.ngeo.ro/test/test3/chat/index.php[/b]


        can u plz add the script here?

        Comment

        Working...
        X