raivis Posted November 22, 2004 Report Share Posted November 22, 2004 (edited) Text dokuments news.txt satur mainīgo $email, kuru vērtību atdala '|': juris@inbox.lv|baiba.e@hotmail.com|peter@grin.org| Kāds izskatītots kods, ja programmai pieprasu: if $email='53767878'; { izdzēst šo nummuru| & echo "Izdzēsts [B]53767878[/B]"; } else if $email= neatrasts; { echo "Jūsu e-adrese nav reģistrēta sistēmā."; } Edited November 23, 2004 by raivis Link to comment Share on other sites More sharing options...
Venom Posted November 23, 2004 Report Share Posted November 23, 2004 $adreses=str_replace(array("\n","\r",' '),'',file_get_contents('adreses.txt')); $adreses=explode('|',$adreses); unset(array_search($meklejama,$adreses)); $fh=fopen('adreses.txt','w'); fwrite($fh,implode('|',$adreses)); fclose($fh); ? Link to comment Share on other sites More sharing options...
raivis Posted November 23, 2004 Author Report Share Posted November 23, 2004 (edited) Kur kļūda...? Fatal error: Can't use function return value in write context in c:\www\unregister.php on line 4 adreses.txtjuris@inbox.lv|baiba.e@hotmail.com|peter@grin.org unregister.php <?php $adreses=str_replace(array("\n","\r",' '),'',file_get_contents('adreses.txt')); $adreses=explode('|',$adreses); unset(array_search($meklejama,$adreses)); $fh=fopen('adreses.txt','w'); fwrite($fh,implode('|',$adreses)); fclose($fh); ?> ??????????????????????????????????????? if $meklejama = atrasta($adreses); { delete atrastais $meklejama; echo "Jūsu e-pasta adrese $meklejama veiksmīgi atreģistrēta"; } else if $meklejama nav atrasta($adreses); { echo "Adrese nav reģisrēta sistēmā!"; } ??????????????????????????????????????? Edited November 25, 2004 by raivis Link to comment Share on other sites More sharing options...
Recommended Posts