Tutorials Scripts Free Q&A Books


 







:שמתשמ
:המסיס
  

1 :םויה תוסינכ
48 :שדוחה תוסינכ
1 :ןיילנוא םישלוג
רחא PHP CGI ASP JavaScript Cold Fusion JSP

CGIב םיטפירקס


ויקיסיא ןודעומ
Dojo :רבחמה םש
Http://Www.Dojo.Co.iL :תיב-רתא

:תורעה\תויחנה
תפשב ויקיסיא ןודעומ והז ,בל ומיש
perl
םכל רוזעי ינאו ליימיאל ילא ונפת תויעבב םילקתנ םתא םא
!!! הז גוסמ םיצבקב ךמות םכלש תרשהש בל ומיש ,בגא
אטאד ץבוק ורצ ,והשמ דועו
icq.data
םימשרנה לש םינותנה לכ וסנכוי וילאש
!!! ונהת

א םינתונו הפשב םיכמותש םירתא

:דוק

-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=




#!/usr/bin/perl

print "Content-type:text/html\n\n" ;

$buffer = $ENV{'QUERY_STRING'} ;
if ($buffer eq "") { $buffer = <STDIN>}

@indata = split (/&/, $buffer) ;

foreach $field (@indata) {
($name, $value) = split (/=/, $field) ;
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value ;
}

if ($FORM{'action'} eq 'join') { ShowTheForm() }
elsif ($FORM{'action'} eq 'add_entry') { AddDataToFile() }
elsif ($FORM{'action'} eq 'show') { DisplayBookToHTML() }
else {
print "<h2><center> -=> Error <=- </h2>";
}

#end program

sub ShowTheForm {
print <<endForm
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
<title>מועדון איסיקיו</title>
</head>
<body bgcolor="#ffffff" text="#000000">
<center>
<h4>הרשמה למועדון האיסיקיו שלי</h4>
<BR>
<form action="icq.pl" method="post">
<input type="hidden" name="action" value="add_entry">
: שם <br>
<input type="text" name="name" size="12" dir="rtl" maxlength="13"><br>
:שורה חופשית<br>
<input type="text" name="freeline" dir="rtl" size="40" maxlength="30"><br>
:מספר איסיקיו <br>
<input type="text" name="icq" size="8" maxlength="8"><br><br>
<input type="reset" value="מחק הכל"> <input type="submit" value="הוסף לרשימה">
</form>
</body>
</html>
endForm
;
}

sub AddDataToFile {
if ($FORM{'icq'} eq "") {
ShowTheForm() ;
exit ;
}
$OutString .= "$FORM{'name'}|" ;
$OutString .= "$FORM{'icq'}|" ;
$OutString .= "$FORM{'freeline'}|" ;
$OutString .= "\n" ;
open (OUTF, ">>icq.data") ;
print OUTF $OutString ;
close (OUTF) ;
DisplayBookToHTML () ;
}

sub DisplayBookToHTML {
open (INF, "icq.data") ;
@datafile = <INF> ;
close (INF) ;
@datafile = reverse(@datafile) ;
print <<endHead
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
<title>מועדון איסיקיו</title>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#000000">
<center>
<h4>לפניכם כל הנרשמים למועדון האיסיקיו שלי</H4>
<BR>
<p>

endHead
;

$items_per_page = 10;
$number_of_items = scalar(@datafile);
$current_page = 0;
if (exists $FORM{'page'}) {
$current_page = $FORM{'page'};
}

$start = $items_per_page * $current_page;
$end = $items_per_page * ($current_page + 1);

for ($item = $start; $item < $end && $item < $number_of_items; $item++ ) {
$i = $datafile[$item];
chomp ($i) ;
($name, $icq, $freeline) = split (/\|/, $i) ;
if ($freeline eq "") { print "<table border=\"0\" width=\"50%\"><tr bgcolor=\"#FBEDB7\"><td><div align=\"center\"><center><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><TD><center><a href=\"http://wwp.mirabilis.com/scripts/Search.dll?to=$icq\"><img src=http://online.mirabilis.com/scripts/online.dll?icq=$icq&img=5 border=\"0\" hieght=\"18\" width=\"18\"></a> $icq ,$name </td></tr></table></center></div></td></tr><tr><td bgcolor=\"#4E94F4\"><p align=\"center\"> $name </p></td></tr></table><BR>\n" }
else { print "<table border=\"0\" width=\"50%\"><tr bgcolor=\"#FBEDB7\"><td><div align=\"center\"><center><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><TD><center><a href=\"http://wwp.mirabilis.com/scripts/Search.dll?to=$icq\"><img src=http://online.mirabilis.com/scripts/online.dll?icq=$icq&img=5 border=\"0\" hieght=\"18\" width=\"18\"></a> $icq ,$name </td></tr></table></center></div></td></tr><tr><td bgcolor=\"#4E94F4\"><p align=\"center\"> $freeline </p></td></tr></table><BR>\n" }
}

use integer;
$number_of_pages = $number_of_items / $items_per_page
+ (($number_of_items % $items_per_page) != 0);
no integer;

for ($count = 0; $count < $number_of_pages; $count++) {
if ($count == $current_page) {
print "[", ($count + 1), "] ";
} else {
print "[<a href='icq.pl?action=show&page=$count'>", ($count + 1) ,"</a>] ";
}
}
print "";

print <<endFoot

<p>
<BR><BR>
<a href="icq.pl?action=join">הצטרפ/י לרשימה</A>
</center>
</body>
</html>
endFoot
;
}



-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=

 

הרזח >>
...