Sasa Posted May 3, 2006 Report Share Posted May 3, 2006 Skripts atbildee par URL pievienoshanu agraaks straadaaj tagad nestraadaa: if($_SERVER['REQUEST_METHOD'] == 'POST'){ if(@!$_SESSION['aa']){ //ierakstiishana failaa $vertiba = $_POST['url']; $vertiba_wrap = wordwrap($vertiba, 20, "\n", 1); if (trim($vertiba)!= '' && trim($vertiba) != 'http://') { //vertiba nav tuksa rakstam faila $fails = 'url.txt'; $txt=$vertiba_wrap."::"; $f=file($fails); $g=fopen($fails,'a'); fwrite($g,$txt); fclose($g); $_SESSION['aa'] = 2; } } } uz Apache maajas straadaa bet uz servera kaut kaadi negrib! nezinu pat ko dariit ja te straadaa bet tur nestraadaa! ?? Link to comment Share on other sites More sharing options...
v3rb0 Posted May 3, 2006 Report Share Posted May 3, 2006 moš tiesības? konzolē ieraksti touch url.txt chmod 777 url.txt Link to comment Share on other sites More sharing options...
Sasa Posted May 3, 2006 Author Report Share Posted May 3, 2006 tas bija pirmais ko skatiijos tur viss ir OK! bet tagad uz maajas serveri taads pats joks vecejaa versijaa viss straadaa bet jaunajaa nekaa tas pat variant kas uz servera! tagad nezinu ko lai domaa! kaut kas nesaprotam pat failaa neko neieraksta, sapratu, ka neizvada,bet ka kad neieraksta ... nu nezinu Link to comment Share on other sites More sharing options...
Blitz Posted May 3, 2006 Report Share Posted May 3, 2006 atri aci uzmetot... if (trim($vertiba)!= '' && trim($vertiba) != 'http://') { nav jabut sitaa? if (trim($vertiba)!== '' && trim($vertiba) !== 'http://') { Link to comment Share on other sites More sharing options...
Sasa Posted May 3, 2006 Author Report Share Posted May 3, 2006 nee taa nav jaabuut! Man ir pareizi! Link to comment Share on other sites More sharing options...
litt Posted May 3, 2006 Report Share Posted May 3, 2006 (edited) Lieto veco labo step by step debug metodi.. Aiz katra IFa ieliec pa echo un skaties cik tālu skritps izpildās, ja kaut kur apraujās, tad sāc domāt kapēc tas tā notiek Edited May 3, 2006 by litt Link to comment Share on other sites More sharing options...
Sasa Posted May 3, 2006 Author Report Share Posted May 3, 2006 atsaaka straadat nokomenteejot aaris rindinjas: if($_SERVER['REQUEST_METHOD'] == 'POST'){ //if(@!$_SESSION['aa']){ //nokomenteets lai neizpildaas!!!!!!!!!!! //ierakstiishana failaa $vertiba = $_POST['url']; $vertiba_wrap = wordwrap($vertiba, 20, "\n", 1); if (trim($vertiba)!= '' && trim($vertiba) != 'http://') { //vertiba nav tuksa rakstam faila $fails = 'url.txt'; $txt=$vertiba_wrap."::"; $f=file($fails); $g=fopen($fails,'a'); fwrite($g,$txt); fclose($g); $_SESSION['aa'] = 2; } } // nokomenteets lai neizpildaas!!!!!!!! } peec shaadaam darbiibaam atsaaka straadaat! Link to comment Share on other sites More sharing options...
Paulinjsh Posted May 3, 2006 Report Share Posted May 3, 2006 (edited) Mok nav session_start? Edited May 3, 2006 by Paulinjsh Link to comment Share on other sites More sharing options...
SkaKri Posted May 4, 2006 Report Share Posted May 4, 2006 (edited) nee taa nav jaabuut! Man ir pareizi! tad kādēļ ko mainīt? line 18 mani fascinēja: } // nokomenteets lai neizpildaas!!!!!!!! labi nokomentēts! Edited May 4, 2006 by SkaKri Link to comment Share on other sites More sharing options...
SkaKri Posted May 4, 2006 Report Share Posted May 4, 2006 (edited) if (($_SERVER['REQUEST_METHOD'] == 'POST') && (@!$_SESSION['aa'])) { $vertiba = $_POST['url']; $vertiba_wrap = wordwrap($vertiba, 20, "\n", 1); if ((trim($vertiba)!= '') && (trim($vertiba) != 'http://')) { $txt = $vertiba_wrap.'::'; $g = fopen('/home/user/tu/pats/url.txt','a'); //ērtāk, ja vairākās vietās izmantojas fwrite($g,$txt); fclose($g); $_SESSION['aa'] = 2; } } ps - noņem @ - apskaties ko šamais rāda. Edited May 4, 2006 by SkaKri Link to comment Share on other sites More sharing options...
Recommended Posts