#!/usr/bin/perl -w
use diagnostics;
use strict;
use CGI qw(:standard escapeHTML);
use CGI::Carp qw(fatalsToBrowser);
use Net::SMTP;
##use FileHandle;
use Captcha::reCAPTCHA;
use CGI::Safe;
use CGI::Simple;
use constant PUBLIC_KEY => '6Le***************1rq03wAyR';
use constant PRIVATE_KEY => '6LeEMA*******************jrLjM2dpN ';
$|++;
my $c;
my $cgi;
my $key;
my $q;
my %etats;
my $ecran_actuel;
my @options;
my $error = undef;
##my $errortest;
##my $resulttest;
$cgi = new CGI;
$c = Captcha::reCAPTCHA->new;
$q = CGI::Simple->new;
%etats = (
'defaut' =>&saisie_commande,
'validation_code' =>&validation_code,
'annulation' =>&annulation,
);
$ecran_actuel = param(".Etat") || "defaut";
die "Pas d'ecran pour $ecran_actuel" unless $etats{$ecran_actuel};
## engendre le document courant
en_tete_standard();
while ( my ($nom_ecran,$fonction) = each %etats){
$fonction->($nom_ecran eq $ecran_actuel);
}
pied_de_page_standard();
########################################################################
## fonctions d en tete , de pied de page ,de menu ################
########################################################################
sub en_tete_standard {
print header(),
start_html(-Title => "commande" , -BGCOLOR=>"White");
print start_form();
}
sub menu_boutique {
my(@options) = @_;
print p(vers_doc($options[0]),
vers_doc($options[1]));
}
..................
eval {
########################################eval { my $eval = fonc();}
plugin captcha
print $c->get_html(PUBLIC_KEY);##je sais pas on pourait faire une
fonction qui prends comme argument fonction(@donnees,$eval)
my $result = $c->check_answer(
PRIVATE_KEY,$ENV{'REMOTE_ADDR'},my $challenge,my $response);
if ( $result->{is_valid} ) {
print "ok";validation_code();
}
else {
my $error = $result->{error};annulation();
}
menu_boutique(@options);
}
}
sub validation_code {
my($actif) = @_;
return unless $actif;
my $nom = param ('nom');
my $adresse = param ('adresse');
my $ville = param ('ville');
my $code_postal = param ('code_postal');
my $pays = param ('pays');
my $mail = param ('mail');
my @gadgets = qw(nom adresse ville code_postal pays mail);
unless ( $actif ) {
print map { hidden($_) } @gadgets;
return;
}
print p("code verifier");
}
sub annulation {
my($actif) = @_;
return unless $actif;
print p ("vous etes une mauvaise personne ou un robot spammeur :");
}
sub menu_boutique {
my(@options) = @_;
print p(vers_doc($options[0]),
vers_doc($options[1]));
je n arrive pas à recuperer les parametres du code recaptcha
le script fonctionne le plugin recaptcha est bien afficher
mais quand je clicke sur validation_code
j ai cette sortie
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>commande</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body bgcolor="White">
<form method="post" action="/cgi-bin/vente.cgi"
enctype="multipart/form-data">
</form>
</body>
</html>
meme pas le print p("");
je suis un peu troubler car je ne comprends pas
question serveur je viens de commander un rps chez ovh avec un centos
et j aurais les depots remi actif
et un yum -v install perl*
et le plugin captcha
#!/usr/bin/perl -w
use diagnostics;
use strict;
use CGI qw(:standard escapeHTML);
use CGI::Carp qw(fatalsToBrowser);
use Net::SMTP;
##use FileHandle;
use Captcha::reCAPTCHA;
use CGI::Safe;
use CGI::Simple;
use constant PUBLIC_KEY => '6Le***************1rq03wAyR';
use constant PRIVATE_KEY => '6LeEMA*******************jrLjM2dpN ';
$|++;
my $c;
my $cgi;
my $key;
my $q;
my %etats;
my $ecran_actuel;
my @options;
my $error = undef;
##my $errortest;
##my $resulttest;
$cgi = new CGI;
$c = Captcha::reCAPTCHA->new;
$q = CGI::Simple->new;
%etats = (
'defaut' =>&saisie_commande,
'validation_code' =>&validation_code,
'annulation' =>&annulation,
);
$ecran_actuel = param(".Etat") || "defaut";
die "Pas d'ecran pour $ecran_actuel" unless $etats{$ecran_actuel};
## engendre le document courant
en_tete_standard();
while ( my ($nom_ecran,$fonction) = each %etats){
$fonction->($nom_ecran eq $ecran_actuel);
}
pied_de_page_standard();
########################################################################
## fonctions d en tete , de pied de page ,de menu ################
########################################################################
sub en_tete_standard {
print header(),
start_html(-Title => "commande" , -BGCOLOR=>"White");
print start_form();
}
sub menu_boutique {
my(@options) = @_;
print p(vers_doc($options[0]),
vers_doc($options[1]));
}
..................
eval {
########################################eval { my $eval = fonc();}
plugin captcha
print $c->get_html(PUBLIC_KEY);##je sais pas on pourait faire une
fonction qui prends comme argument fonction(@donnees,$eval)
my $result = $c->check_answer(
PRIVATE_KEY,$ENV{'REMOTE_ADDR'},my $challenge,my $response);
if ( $result->{is_valid} ) {
print "ok";validation_code();
}
else {
my $error = $result->{error};annulation();
}
menu_boutique(@options);
}
}
sub validation_code {
my($actif) = @_;
return unless $actif;
my $nom = param ('nom');
my $adresse = param ('adresse');
my $ville = param ('ville');
my $code_postal = param ('code_postal');
my $pays = param ('pays');
my $mail = param ('mail');
my @gadgets = qw(nom adresse ville code_postal pays mail);
unless ( $actif ) {
print map { hidden($_) } @gadgets;
return;
}
print p("code verifier");
}
sub annulation {
my($actif) = @_;
return unless $actif;
print p ("vous etes une mauvaise personne ou un robot spammeur :");
}
sub menu_boutique {
my(@options) = @_;
print p(vers_doc($options[0]),
vers_doc($options[1]));
je n arrive pas à recuperer les parametres du code recaptcha
le script fonctionne le plugin recaptcha est bien afficher
mais quand je clicke sur validation_code
j ai cette sortie
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>commande</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body bgcolor="White">
<form method="post" action="/cgi-bin/vente.cgi"
enctype="multipart/form-data">
</form>
</body>
</html>
meme pas le print p("");
je suis un peu troubler car je ne comprends pas
question serveur je viens de commander un rps chez ovh avec un centos
et j aurais les depots remi actif
et un yum -v install perl*
et le plugin captcha
#!/usr/bin/perl -w
use diagnostics;
use strict;
use CGI qw(:standard escapeHTML);
use CGI::Carp qw(fatalsToBrowser);
use Net::SMTP;
##use FileHandle;
use Captcha::reCAPTCHA;
use CGI::Safe;
use CGI::Simple;
use constant PUBLIC_KEY => '6Le***************1rq03wAyR';
use constant PRIVATE_KEY => '6LeEMA*******************jrLjM2dpN ';
$|++;
my $c;
my $cgi;
my $key;
my $q;
my %etats;
my $ecran_actuel;
my @options;
my $error = undef;
##my $errortest;
##my $resulttest;
$cgi = new CGI;
$c = Captcha::reCAPTCHA->new;
$q = CGI::Simple->new;
%etats = (
'defaut' =>&saisie_commande,
'validation_code' =>&validation_code,
'annulation' =>&annulation,
);
$ecran_actuel = param(".Etat") || "defaut";
die "Pas d'ecran pour $ecran_actuel" unless $etats{$ecran_actuel};
## engendre le document courant
en_tete_standard();
while ( my ($nom_ecran,$fonction) = each %etats){
$fonction->($nom_ecran eq $ecran_actuel);
}
pied_de_page_standard();
########################################################################
## fonctions d en tete , de pied de page ,de menu ################
########################################################################
sub en_tete_standard {
print header(),
start_html(-Title => "commande" , -BGCOLOR=>"White");
print start_form();
}
sub menu_boutique {
my(@options) = @_;
print p(vers_doc($options[0]),
vers_doc($options[1]));
}
..................
eval {
########################################eval { my $eval = fonc();}
plugin captcha
print $c->get_html(PUBLIC_KEY);##je sais pas on pourait faire une
fonction qui prends comme argument fonction(@donnees,$eval)
my $result = $c->check_answer(
PRIVATE_KEY,$ENV{'REMOTE_ADDR'},my $challenge,my $response);
if ( $result->{is_valid} ) {
print "ok";validation_code();
}
else {
my $error = $result->{error};annulation();
}
menu_boutique(@options);
}
}
sub validation_code {
my($actif) = @_;
return unless $actif;
my $nom = param ('nom');
my $adresse = param ('adresse');
my $ville = param ('ville');
my $code_postal = param ('code_postal');
my $pays = param ('pays');
my $mail = param ('mail');
my @gadgets = qw(nom adresse ville code_postal pays mail);
unless ( $actif ) {
print map { hidden($_) } @gadgets;
return;
}
print p("code verifier");
}
sub annulation {
my($actif) = @_;
return unless $actif;
print p ("vous etes une mauvaise personne ou un robot spammeur :");
}
sub menu_boutique {
my(@options) = @_;
print p(vers_doc($options[0]),
vers_doc($options[1]));
je n arrive pas à recuperer les parametres du code recaptcha
le script fonctionne le plugin recaptcha est bien afficher
mais quand je clicke sur validation_code
j ai cette sortie
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>commande</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body bgcolor="White">
<form method="post" action="/cgi-bin/vente.cgi"
enctype="multipart/form-data">
</form>
</body>
</html>
meme pas le print p("");
je suis un peu troubler car je ne comprends pas
question serveur je viens de commander un rps chez ovh avec un centos
et j aurais les depots remi actif
et un yum -v install perl*
et le plugin captcha