Вы находитесь на странице: 1из 3

#!/??

/perl
# Created and modified by Thomas EZAN, june 2007, tezan.enssat@gmail.com

# This program is free software; you can redistribute it and/or modify


# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

use CGI;

#Get the variables from the CGI script


$form=new CGI;

$f_brand=CGI::escapeHTML($form->param("f_brand"));
$f_ndevice=CGI::escapeHTML($form->param("f_ndevice"));
$f_kdevice=CGI::escapeHTML($form->param("f_kdevice"));
$f_exhib=CGI::escapeHTML($form->param("f_exhib"));
$f_market=CGI::escapeHTML($form->param("f_market"));
$f_price=CGI::escapeHTML($form->param("f_price"));
$f_colors=CGI::escapeHTML($form->param("f_colors"));
$f_text=CGI::escapeHTML($form->param("f_text"));

#Start to edit the HTML document


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

print '<html>';
print '<head>';
print '<meta name="author" content="Thomas EZAN">';
print '<link href="xampp.css" rel="stylesheet" type="text/css">';
print '</head>';
print '<body>';
print '&nbsp;<p>';
print "<h1>Script AVING (Example for Perl)</h1>";

#print Title
if($f_brand){
print "<h2>";
print "Le '$f_ndevice' de $f_brand";
if($f_kdevice){
print ": $f_kdevice";
}
print "</h2>";
}

#print Summary
if($f_brand){
print "$f_brand ";
print "presente le '$f_ndevice', ";
if($f_kdevice){
print "$f_kdevice";
}
if($f_exhib){
print ", lors du ";
print "$f_exhib.";
if($f_market){
print " L'appareil est annonce sur le marche $f_market";
}
}
elsif($f_market){
print "$aa destination du marche $f_market";
}
}
print '&nbsp;<p>';

#print Content
if($f_brand){
print "$f_brand ";
print "presente le '$f_ndevice', ";
if($f_kdevice){
print "$f_kdevice";
}
if($f_exhib){
print ", lors du ";
print "$f_exhib";
}
print ".";
if($f_text){
print " $f_text.";
}
if($f_colors){
print" Le '$f_ndevice' existe en $f_colors."
}
if($f_market){
print " Disponible sur le marche $f_market pour $f_price.";
}
print '&nbsp;<p>';
print '&nbsp;<p>';
}

#HTML form to get information


print "<p>Add entry:<p>";
print "<form action=test_perl.pl method=get>";
print "<table border=0 cellpadding=0 cellspacing=0>";
print "<tr><td>Brand:</td><td><input type=text size=30 name=f_brand></td></tr>";
print "<tr><td>Device name:</td><td><input type=text size=30
name=f_ndevice></td></tr>";
print "<tr><td>Exhibition:</td><td> <input type=text size=30
name=f_exhib></td></tr>";
print "<tr><td>What is it ?:</td><td> <input type=text size=30
name=f_kdevice></td></tr>";
print "<tr><td>Market:</td><td> <input type=text size=30
name=f_market></td></tr>";
print "<tr><td>Price:</td><td> <input type=text size=30 name=f_price></td></tr>";
print "<tr><td>Colors:</td><td> <input type=text size=30
name=f_colors></td></tr>";
print "<tr><td>Text:</td><td> <textarea type=text rows=3 cols=30
name=f_text></textarea></td></tr>";
print "<tr><td></td><td><input type=submit border=0 value=\"WRITE\"></td></tr>";
print "</table>";
print "</form>";

print "</body>";
print "</html>";

print "</body>";
print "</html>";

Вам также может понравиться