Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Oct 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    WAP Chat script error, please help!

    hi guys,

    i wrote a chat script some time ago on my old server, it was working fine and everything. i canceled my hosting later on, a few months passed and i got a new host, so i uploaded my chat and everything worked fine except my private, which is used at prividis.php

    this is a server problem and i dont know how to fix the code so that it can work again.

    its a flatfile php script used for WAP (mobile phones) but can be accesed from opera, mozzila etc..

    this is the prividis.php code

    PHP Code:
    <?php
    header
    ("Content-type: text/vnd.wap.wml");
    header("display_errors=0");
    echo 
    "<?xml version=\"1.0\"?>";
    echo 
    "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
    \"http://www.wapforum.org/DTD/wml_1.1.xml\">"
    ;
    echo 
    "<!-- procore@waprave.net -->\n";


    $swe_from = array("","","","","","","$","&"); 
    $swe_to = array("""""""""""","[usd]","[and]"); 

    for (
    $t=0$t<count($swe_from); $t++) 

    $nimi str_replace ($swe_from[$t], $swe_to[$t], $nimi); 
    $salasana str_replace ($swe_from[$t], $swe_to[$t], $salasana);
    $viesti str_replace ($swe_from[$t], $swe_to[$t], $viesti);
    $kenelle str_replace ($swe_from[$t], $swe_to[$t], $kenelle);








    $l="0";
    $nimet=file_get_contents('chatpaikalla.txt');
    $nim=file('chatpaikalla.txt');
    $salasana=crypt($salasana,'password');
    $privanimet=file('privnims.txt');
    $privaviestit=file('privnea.txt');
    $salnim=file('nims.txt');
    $salsan=file('sals.txt');
    for (
    $i=0$i<count($nim); $i++) 
    {
    $alo=explode("",$nim[$i]);
    if (
    $nimi==$alo[0]){$l="1";$hee=$nim[$i];}
    }

    $kenelle strtolower($kenelle);
    if (
    $kenelle==''){$kenelle='?';}
    for (
    $i=0$i<count($salnim); $i++) 
    { if (
    rtrim($salsan[$i])==$salasana && rtrim($salnim[$i])==$nimi){$a="1";}}
    if (
    $a !="1"){
    echo 
    "<wml>";
    echo 
    "<card title=\"Private\">";
    echo 
    "<p>";
    echo 
    "You are not logged in! please hit the 'Back' button and login again";
    echo 
    "<br/>Sorry for the invonvinience...<br/>";
    echo 
    "<a href=\"index.php\">Back</a>";
    echo 
    "</p>";
    echo 
    "</card>";
    echo 
    "</wml>";
    exit();
    }

    $nimihtmlspecialchars($nimi);
    $viestihtmlspecialchars($viesti);
    $viestistripslashes($viesti);
    $kenelle=stripslashes($kenelle);
    $nimoni=$viesti;
    $turska=file('toisto.txt');
    if (
    $viesti !=''){

    for (
    $l=0$l<count($turska); $l++) 
    { if (
    rtrim($turska[$l])==$nimoni){$viesti='';}}

    $toistoke fopen('toisto.txt''r+');
    $hypro=file_get_contents ('toisto.txt');  
    $hape=$nimoni '
    $hypro;
      
    fputs($toistoke$hape);
    if (
    filesize('toisto.txt')>400)
      {
    ftruncate ($toistoke,400);}
    fclose($toistoke);
    }

    echo 
    "<wml>";
    echo 
    "<card title=\"Private"; echo "\" ontimer=\"prividis.php?time=";
    echo 
    date('dmHis');echo '&amp;nimi=$nimi&amp;salasana=$salasana';
    echo 
    "\">";
    echo 
    "<timer value=\"200\"/>";
    echo 
    "<p><small>";


    $namehtmlspecialchars($nimi);
    $namestripslashes($nimi);
    $messagehtmlspecialchars($viesti);
    $message=stripslashes($viesti);
    include(
    "smileyarray.php");
    $kuv=file('smileywml.txt');
    for (
    $m=0$m<count($joo); $m++) 


    $viesti str_replace ($joo[$m], rtrim($kuv[$m]), $viesti); 

    $joo='';

    $rumatsanat=file('sensuuri.txt');
    for (
    $ri=0$ri<count($rumatsanat); $ri++) 
    {
    $vaihto=rtrim($rumatsanat[$ri]);
    $viesti str_replace ($vaihto,"@spam@"$viesti);
    }

    $user explode ('/'$HTTP_USER_AGENT);
    $ip = ($REMOTE_ADDR);

    if (
    $viesti !=''){
    if(
    $admin=="4"){$uusirivi ='<a href="pm.php?kenelle='.$nimi.'&amp;nimi=$nimi&amp;salasana=$salasana">'.$nimi.'</a> >> <a href="pm.php?kenelle='.$kenelle.'&amp;nimi=$nimi&amp;salasana=$salasana">'.$kenelle.'</a> <br/>
    '
    ;}else{$uusirivi ='<a href="pm.php?kenelle='.$nimi.'&amp;nimi=$nimi&amp;salasana=$salasana">'.$nimi.'</a> >> <a href="pm.php?kenelle='.$kenelle.'&amp;nimi=$nimi&amp;salasana=$salasana">'.$kenelle.'</a>: '.$viesti.'<br/>
    '
    ;}



      
    $tiedosto fopen('privnea.txt''r+');
      
    $kolmas=file_get_contents ('privnea.txt');
    $tiedosto3 fopen('privnims.txt''r+');
      
    $kolmas3=file_get_contents ('privnims.txt');
      
    $toinen='*'.$kenelle.''.$uusirivi $kolmas;
      
    $toinen3=$kenelle '
    '
    $kolmas3;

        
    fputs($tiedosto$toinen);  fputs($tiedosto3$toinen3);
        
    fclose($tiedosto); fclose($tiedosto3);
    $tiedosto fopen('privnea.txt''r+');
      
    $kolmas=file_get_contents ('privnea.txt');
    $tiedosto4 fopen('privnims.txt''r+');
      
    $kolmas4=file_get_contents ('privnims.txt');

      
    $toinen=$nimi.''.$uusirivi.$kolmas$toinen4=$nimi .'
    '
    .$kolmas4;

        
    fputs($tiedosto$toinen);fputs($tiedosto4$toinen4);
        
    fclose($tiedosto); fclose($tiedosto4); 
    }

    echo 
    "<anchor>Write/";
    echo 
    "<go method=\"post\" href=\"privkirj.php?viesti=\">";
    echo 
    "<postfield name=\"nimi\" value=\"$(nimi)\"/>";
    echo 
    "<postfield name=\"salasana\" value=\"$(salasana)\"/>";
    echo 
    "<postfield name=\"kenelle\" value=\"$(kenelle)\"/>";
    echo 
    "<setvar name=\"viesti\" value=\"\"/>";
    echo 
    "</go>";
    echo 
    "</anchor>";
    echo 
    "<anchor>Chatroom/";
    echo 
    "<go method=\"post\" href=\"chat.php\">";
    echo 
    "<postfield name=\"salasana\" value=\"$(salasana)\"/>";
    echo 
    "<postfield name=\"nimi\" value=\"$(nimi)\"/>";
    echo 
    "</go>";
    echo 
    "</anchor>";
    echo 
    "<anchor>Refresh";
    echo 
    "<go method=\"post\" href=\"prividis.php\">";
    echo 
    "<postfield name=\"salasana\" value=\"$(salasana)\"/>";
    echo 
    "<postfield name=\"nimi\" value=\"$(nimi)\"/>";
    echo 
    "</go>";
    echo 
    "</anchor>\n";
    echo 
    "<br/>";

    $privanimet=file('privnims.txt');
    $privaviestit=file('privnea.txt');


    $lis=0;
    for (
    $q=0$q<count($privaviestit); $q++) {
    $tech=explode("",$privaviestit[$q]);
    $testos=str_replace("*""",$tech[0]);
     if (
    rtrim($testos)==$nimi){
     
    $lis=$lis+1;if ($lis>10){$q=count($privaviestit)+1;}
    $this=str_replace($nimi.''"",$privaviestit[$q]);
     echo 
    $this;
    $korvausfopen('privnea.txt''r+');
    $hypro=file_get_contents ('privnea.txt'); 

    $testi3=$privaviestit[$q];
    $testi3=str_replace("*"""$testi3);
    $hyprostr_replace($privaviestit[$q], $testi3$hypro);
    fputs($korvaus$hypro); 
    fclose($korvaus);
    }
    }
    include(
    "smileyarray.php");
    $kuv=file('smileywml.txt');


    echo 
    "<anchor>Chatroom";
    echo 
    "<go method=\"post\" href=\"chat.php\">";
    echo 
    "<postfield name=\"salasana\" value=\"$(salasana)\"/>";
    echo 
    "<postfield name=\"nimi\" value=\"$(nimi)\"/>";
    echo 
    "</go>";
    echo 
    "</anchor>";echo "<br/>";
    echo 
    "</small></p>";
    echo 
    "</card>";
    echo 
    "</wml>";
    ?>

    when i try to access prividis.php from my chat using opera browser i only get a blank page, i also tried validating the page but it says "The Document `http://chat.waprave.net/prividis.php` could not load!"

    here is the validating link
    http://www.validome.org/validate/?ur...ng=en&doctype=
    doctypeAUTO&charset=charsetAUTO

    the link to the chatroom is http://chat.waprave.net


    IF ANYONE CAN PLEASE HELP ME, HELP ME ASAP!!!!!
    Last edited by Spookster; 10-31-2006 at 07:01 PM.

  • #2
    New to the CF scene
    Join Date
    Oct 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you need to see the complete script please download it from http://waprave.net/noChat.zip

    GUYS PLEASE IM DESPERATE FOR THIS TO BE FIXED, ive tried everything but no luck

  • #3
    New to the CF scene
    Join Date
    Oct 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Please Help Pls Pls Pls

  • #4
    New to the CF scene
    Join Date
    Nov 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Solution...

    Hi bro !!
    I have chkd all codes .
    all working fine but there is little problem with some files.
    remove line from files with content ::
    header("display_errors=0");
    when I download this scripts , it was not working but after removing this from some files , working fine, and thnx a lot , this is nice chat room which I really need , but I need help if u help me, my ID is tariqstone@hotmail.com
    ok BYE n enjoy.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •