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.
Seeing if the syntax of my perl script gives me those errors, I guess they are because I can not send another cgi file in which I have the database connection hosted ... for the moment I am working on a record and the code is this:
#!"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>";
}