View Full Version : WAP Chat script error, please help!

10-31-2006, 06:37 PM
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

header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
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);

for ($i=0; $i<count($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>";

$nimi= htmlspecialchars($nimi);
$viesti= htmlspecialchars($viesti);
$viesti= stripslashes($viesti);
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);}

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>";

$name= htmlspecialchars($nimi);
$name= stripslashes($nimi);
$message= htmlspecialchars($viesti);
for ($m=0; $m<count($joo); $m++)

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

for ($ri=0; $ri<count($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 .'

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/>";


for ($q=0; $q<count($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;
$korvaus= fopen('privnea.txt', 'r+');
$hypro=file_get_contents ('privnea.txt');

$testi3=str_replace("*", "", $testi3);
$hypro= str_replace($privaviestit[$q], $testi3, $hypro);
fputs($korvaus, $hypro);

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

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


10-31-2006, 06:39 PM
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 :( :(

11-01-2006, 04:05 PM
Please Help Pls Pls Pls

11-15-2006, 07:30 PM
Hi bro !!
I have chkd all codes .
all working fine but there is little problem with some files.
remove line from files with content ::
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.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum