SkaKri Posted August 10, 2005 Report Share Posted August 10, 2005 jup. :) beidzot pat ES kko sāku saprast. paldies bubu. :] Link to comment Share on other sites More sharing options...
dutchy Posted August 11, 2005 Author Report Share Posted August 11, 2005 (edited) Paldies strādā saturs ip_log: Valdis=217.145.215.197 Forma Bet vēl vajadzētu if nosacījumu, ja ienāk kāds, tad vispirms jau lai pārbauda, vai nav datubāzē, ja gadījumā ir, tad parāda piemēram ''sveiks ''vārds''=''i.p.'''' . Edited August 11, 2005 by dutchy Link to comment Share on other sites More sharing options...
dutchy Posted August 19, 2005 Author Report Share Posted August 19, 2005 Nu, kurš var palīdzēt? Link to comment Share on other sites More sharing options...
bubu Posted August 19, 2005 Report Share Posted August 19, 2005 Palīdzēt tev palīdzēs jebkurš, bet galvenais pašama arī kautko domāt un taisīt. Vai arī noformulēt savu jautājumu citā veidā - kurš man uztaisīs to un to. A ja gribi lai palīdz, tad uzdod konkrētus jautājumus, nevis - man vajag to un to, kā lai uztaisa? Prasi konkrētas lietas! Link to comment Share on other sites More sharing options...
dutchy Posted August 19, 2005 Author Report Share Posted August 19, 2005 (edited) labi, būtība ir vēl vienkāršāka, pirms lietotājs ievada savu vārdu, scripts pārbauda, vai nav jau tāda i.p. pieregistrējusies, ja atrod, tad neko nerāda. P.S. sistēma atzīmē visus, pat tos kuri nespiež tālāk ->!? Tātad vajag šitās divas lietas- 1 izlabot un otru uztaisīt. test.php: <?php $f = fopen('ip_log.txt', 'a'); fwrite($f, $_POST['username'] . '=' . $_SERVER['REMOTE_ADDR'] . "\n"); fclose($f) ?> Edited August 19, 2005 by dutchy Link to comment Share on other sites More sharing options...
viss_kedaas Posted August 20, 2005 Report Share Posted August 20, 2005 <?php $ip_adreses = file("ip_log.txt"); for($i=0;$i<count($ip_adreses);$i++){ $exp = explode("=", $ip_adreses[$i]); if($_SERVER['REMOTE_ADDR'] == trim($exp[1]){ $jau_regots = true; $dati = array($exp[0],$exp[1]); } } if ($jau_regots == true){ echo 'Sveiks '.$dati[0]; } else { // HTML Forma } ?> nu apmēram tā... :ph34r: Link to comment Share on other sites More sharing options...
dutchy Posted August 21, 2005 Author Report Share Posted August 21, 2005 http://www.srt.lv/registracija/test.php kaut kas viņam nepatīk test.php saturs <?php $ip_adreses = file("ip_log.txt"); for($i=0;$i<count($ip_adreses);$i++){ $exp = explode("=", $ip_adreses[$i]); if($_SERVER['REMOTE_ADDR'] == trim($exp[1]){ $jau_regots = true; $dati = array($exp[0],$exp[1]); } } if ($jau_regots == true){ echo 'Sveiks '.$dati[0]; } else { // HTML Forma } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1257"> <STYLE TYPE="text/css"><!-- BODY { scrollbar-arrow-color:red; scrollbar-track-color:red; scrollbar-shadow-color:white; scrollbar-face-color:white; scrollbar-highlight-color:red; scrollbar-darkshadow-color:red; scrollbar-3dlight-color:red; } //--></STYLE> </head> <body bgcolor=red text=white vLink=white aLink=white link=white> <form action="test_ok.php" method="post"> <table> <tr><td><font size="1" face="Verdana">Ievadi savu vārdu:</font></td><td><input type="text" name="username"></td><td><input type="image" src="talak.gif" name="submit" value="saglabāt"></td></tr> </form> </html> test_ok.php saturs: <?php $f = fopen('ip_log.txt', 'a'); fwrite($f, $_POST['username'] . '=' . $_SERVER['REMOTE_ADDR'] . "\n"); fclose($f) ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1257"> <STYLE TYPE="text/css"><!-- BODY { scrollbar-arrow-color:red; scrollbar-track-color:red; scrollbar-shadow-color:white; scrollbar-face-color:white; scrollbar-highlight-color:red; scrollbar-darkshadow-color:red; scrollbar-3dlight-color:red; } //--></STYLE> </head> <body bgcolor=red text=white vLink=white aLink=white link=white> <font size="1" face="Verdana"> <b>Sveiki, [username]</b> </html> Link to comment Share on other sites More sharing options...
bubu Posted August 21, 2005 Report Share Posted August 21, 2005 kaut kas viņam nepatīk ļoti izsmeļošs problēmas apraksts... Būtu pats atvēris savu lapu un izlasījis kļūdas aprakstu. Manuprāt ļoti skaidri pateikts, kas 5-tajā rindiņā par kļūdu. Link to comment Share on other sites More sharing options...
SkaKri Posted August 21, 2005 Report Share Posted August 21, 2005 (edited) pfff, kam tev to iekš test_ok vajag: fwrite($f, $_POST['username'] . '=' . $_SERVER['REMOTE_ADDR'] . "\n"); ??? :P bzummmm Edited August 21, 2005 by SkaKri Link to comment Share on other sites More sharing options...
bubu Posted August 21, 2005 Report Share Posted August 21, 2005 SkaKri, a moš nevajag bezjēgā quotēt? Citādi topiks izstiepjās kilometriem garš! Link to comment Share on other sites More sharing options...
dutchy Posted August 21, 2005 Author Report Share Posted August 21, 2005 A kāda kļūda tad ir tajā test.php scriptā, ko parse error nozīmē? Link to comment Share on other sites More sharing options...
bubu Posted August 21, 2005 Report Share Posted August 21, 2005 Parse error nozīmē sintaktisku kļūdu, t.i. tu php interpretatoram padevi skriptu, kas neatbilst php valodas konstrukcijām. Nu, piemēram, kautvai ierakstot php failā kauto šādu, lai tas tiktu izpildīts: {(*@)#*$}@}!P#L noteikti būs parse error, jo php vienkārši nesapratīs, ko tu ar to prasi. Link to comment Share on other sites More sharing options...
flasherr Posted August 21, 2005 Report Share Posted August 21, 2005 piem. šis (no http://www.srt.lv/registracija/test.php ) Parse error: parse error, unexpected '{' in /usr/data/wwwroot_com/srt.lv/html/registracija/test.php on line 5 failā test.php 5 rindā lieks "{" Link to comment Share on other sites More sharing options...
bubu Posted August 21, 2005 Report Share Posted August 21, 2005 Nevis lieks, bet negaidīts (unexpected). Varianti divi - vai nu kā flasherr teica, lieks {, vai nu par ātru uzlikts, jo kautkas pirms tā aizmirsts uzlikt. Link to comment Share on other sites More sharing options...
viss_kedaas Posted August 22, 2005 Report Share Posted August 22, 2005 Šajā gadījumā par ātru, jo trūkst ) Link to comment Share on other sites More sharing options...
Recommended Posts