Jump to content
php.lv forumi

GXC

Reģistrētie lietotāji
  • Posts

    3
  • Joined

  • Last visited

GXC's Achievements

Newbie

Newbie (1/14)

  1. beigas sataisiju ar shitadu: <? // Create New DB if the DB not found if (!file_exists("$dbfile")) { $fnew = fopen("$dbfile", "w+"); flock($fnew, 1); } else { // Do nothing } ?>
  2. sveiki, doma ir uzraxtit skriptu kas parbauditu vai tads fails eksiste un ja nee tad izveidot jaunu. Nu es uzraxtiju shadu: if(is_readable($dbfile)) { // Do nothing } else { $fnew = fopen("$dbfile", "w+"); flock($fnew, 1); } Vinsh man izgatavo jaunu jebkura gadijuma(ja tads fails jau ir vai nav)
  3. Kā lai uzlabo šādu php kodu lai ja tāda IP adrese jau eksistē lai tas ne-log'otu velreiz? <?php $file = fopen("index.php", "a"); $time = date("dS F[H:i]"); fwrite($file, "$time" ); if( $REMOTE_ADDR != null) { fwrite($file," - <b>$REMOTE_ADDR</b> - $HTTP_USER_AGENT <br> "); } if( $HTTP_REFERER != null) { fwrite($file,""); } fwrite($file,""); fclose($file) ?> Paldies
×
×
  • Create New...