Global symbol "$mysqli" requires explicit package name at register.cgi line 15.
Global symbol "$dbh" requires explicit package name at register.cgi line 30.
Global symbol "$dbh" requires explicit package name at register.cgi line 36.
register.cgi had compilation errors.
Al ver si la sintaxis de mi script de perl me salen esos errores supongo que son porque no puedo mandar a llamar otro archivo cgi en el cual tengo alojada la conexión a la base de datos ... por el momento estoy trabajando en un registro y el código es este :
#!"C:\xampp\perl\bin\perl.exe"
require conexion.cgi;
use CGI;
use DBI;
use strict;
my $cgi = new CGI;
my $nombre = $cgi->param('f_name');
my $apellido = $cgi->param('l_name');
my $email = $cgi->param('email');
my $pass = $cgi->param('password');
my $mobile = $cgi->param('mobile');
my $adre1 = $cgi->param('address1');
my $adre2 = $cgi->param('address2');
my $sql = $mysqli->prepare("select user_id from user_info where email ='$email'");
my $con=$sql->execute() or die $DBI::errstr;
my $count=$con->rows;
if($count>0){
print $cgi->header(-type=> 'text/html',
-charset=>'utf-8');
print "<script>alert('El correo ya existe')</script>";
print "
<script>
window.history.go(-1);
exit;
</script>';";
return;
}
else{
my $sth = $dbh->prepare("INSERT INTO user_info
(first_name, last_name,email, password,mobile,address1,address2)
values
('$nombre', '$apellido', '$email', '$pass', '$mobile','$adre1','$adre2')");
$sth->execute() or die $DBI::errstr;
$sth->finish();
$dbh->commit or die $DBI::errstr;
print $cgi->header(-type=> 'text/html',
-charset=>'utf-8');
print "<script>alert('Se registro exitosamente')</script>";
}
bind_param