home *** CD-ROM | disk | FTP | other *** search
Wrap
<HTML> <HEAD> <meta "Title"="Korespondent.pl - serwis polityczny"> <meta "Author"="Marcin Hugo Kosi±ski"> <meta "Subject"="Polityka, gospodarka, spo│ecze±stwo, kultura"> <meta "Description"="Niezale┐ny magazyn polityczno - spo│eczny zajmuj╣cy siΩ komentowaniem aktualnych wydarze± z punktu widzenia ludzi ceni╣cych wolno£µ."> <meta "Keywords"="polityka, wolno£µ, konserwatyzm, liberalizm, libertarianizm, komunizm, socjalizm, socjaldemokracja, anarchizm, demokracja, magazyn, miesiΩcznik, komentarz, wybory, prezydent, rz╣d, sejm, senat, parlament, pa±stwo, polska, ameryka, izrael, usa, nacjonalizm, wolny, rynek, upr, nczas, media, protekcjonizm, dziennikarstwo, wybory, samorz╣d, kapitalizm, ekonomia, gospodarka, bud┐et, trzecia droga, papie┐, watykan, biblia, wiara, katolicyzm, katolik, janusz korwin mikke, janusz michalkiewicz, handel, pieni╣dze, wiadomo£ci, newsy, informacje, fakty"> <meta name "Rating" Content="Rating"> <meta name "Robots" Content="Robots"> <meta name "Revisit" Content="1 days"> <META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=windows-1250"> <BODY> <!-- Tu sie zaczyna skrypt PHP. Dotad mozna modyfikowac --> <?php $DATABASE_PATH = "../database"; $id = $HTTP_POST_VARS["id"]; $pass = $HTTP_POST_VARS["pass"]; $title = $HTTP_POST_VARS["title"]; $news = $HTTP_POST_VARS["news"]; Trim ($id); Trim ($pass); $file_name = "$DATABASE_PATH/users/$id.txt"; if (File_Exists ($file_name)) { /* Get data from user file */ $f = fopen ($file_name, "r"); fscanf ($f, "%s", $file_1); fscanf ($f, "%s", $file_2); fscanf ($f, "%s", $file_3); fscanf ($f, "%s", $file_4); fscanf ($f, "%s", $file_access); fscanf ($f, "%s", $file_password); fscanf ($f, "%s", $file_stats); fclose ($f); if (!strcmp ($pass, $file_password)) { if ((!strcmp ($file_access, "admin")) || (!strcmp ($file_access, "registered"))) { $counter_name = "$DATABASE_PATH/news/last"; $news_path = "$DATABASE_PATH/news"; ///////////////////////////// printf ('DziΩkujemy za umieszczenie newsa. Za chwilΩ pojawi siΩ on na stronie korespondent.pl<BR>'); ///////////////////////////// } else { $counter_name = "$DATABASE_PATH/moderate/last"; $news_path = "$DATABASE_PATH/moderate"; ///////////////////////////// printf ('News zosta│ wys│any do moderatora. Jak tylko zostanie przez niego zaakceptowany, pojawi siΩ na stronie korespondent.pl<BR>'); ///////////////////////////// } /* Deal with the counter (file 'last') */ $counter = 0; if (File_Exists ($counter_name)) { $last_file = fopen ($counter_name, "r"); fscanf ($last_file, "%d", $counter); fclose ($last_file); } $counter++; $last_file = fopen ($counter_name, "w"); fputs ($last_file, "$counter"); fclose ($last_file); /* Good, counter incremented and updated. */ /* Now create the news file */ $f = fopen ("$news_path/$counter.txt", "w"); fputs ($f, "$id\n"); $date = Date ("Y m d"); fputs ($f, "$date\n"); fputs ($f, "$title\n"); fputs ($f, "$news\n"); fclose ($f); /* Update user statistics */ $f = fopen ($file_name, "w"); fputs ($f, "$file_1\n"); fputs ($f, "$file_2\n"); fputs ($f, "$file_3\n"); fputs ($f, "$file_4\n"); fputs ($f, "$file_access\n"); fputs ($f, "$file_password\n"); $file_stats++; fputs ($f, "$file_stats\n"); fclose ($f); } else { ///////////////////////////// printf ('Wpisa│e£ nieprawid│owe has│o.<BR>'); ///////////////////////////// } } else { ///////////////////////////// printf ('Poda│e£ nieprawid│owy identyfikator.<BR>'); ///////////////////////////// } ?> <!-- Tu sie konczy skrypt PHP. Dalej mozna modyfikowac --> </BODY> </HTML>