#!/usr/bin/perl
use strict;
use CGI qw/:standard :html3 *table/;
require "functions.pl";
our ($DBHost,$TMDBName,$TMDBUser,$TMDBPass,%TMAMOUNTS);
our ($sendmail,$tmuploaddir);
our ($tmowneremail,$tmownerdesc);
my ($id,$str);
my ($dbh,$sth,$rc,$query,@a);
$id=(param('id'))?param('id'):"";
$str=(param('str'))?param('str'):"";
#########
if (!$id || $id eq "") { missing("id");exit(110); }
if (!$str || $str eq "") { missing("str");exit(110); }
###############
# Checking into database.
$dbh = DBI->connect("dbi:mysql:dbname=$TMDBName;host=$DBHost","$TMDBUser","$TMDBPass",
{
PrintError => 0,
RaiseError => 0,
AutoCommit => 1
});
if (!defined($dbh)){
print_error("Database Error:","$DBI::errstr");
exit(1);
}
$a[0]=quotemeta($id);
$a[1]=quotemeta($str);
$query="SELECT result,firstname FROM trademark WHERE id='$a[0]' AND randstr='$a[1]'";
$sth = $dbh->prepare($query);
if (!$sth) {
print_error("[DBI]: Prepare Error Occured!",$DBI::errstr);
$dbh->disconnect();
exit(1);
}
$rc=$sth->execute;
if (!$rc) {
print_error("[DBI]: Execute Error Occured!",$DBI::errstr);
$sth->finish;
$dbh->disconnect;
exit(1);
}
undef(@a);
@a=$sth->fetchrow_array;
if (!@a || $a[0] eq ""){
$sth->finish;
$dbh->disconnect();
print_error("Cannot auth your request! Exit!");
exit(113);
}
$sth->finish;
$dbh->disconnect();
###### Download page
print<<"HTML";
Content-type: text/html
Trademark Search : : Completed
Welcome back $a[1],
Your search results are ready to be reviewed. We have
posted our comments to the probability of the Trademark
you requested being filed. Filing any trademark with the
U.S. Government is not guaranteed, however all trademarks
have a 50/50 filing ratio. There are many factors in filing
for a trademark, this is where our filing services actually
assist you in the process. We can submit your request directly
into the U.S. Trademark system within 3 days. This at least gets
your trademark in que for filing. The sooner you have the
application submitted, the better the chances are for your filing.
Bizincusa / Trademark USA also offers monitoring of existing
trademarks, as well as the monitoring of the filing process. If
you are interested in these services, please email tmarks\@bizincusa.com
We do appreciate your business and want you to know that we
uphold the strictest policy of privacy and do not offer our clients
data to third or any party for that matter.
Click below for your results, after reviewing, if you have any questions
please feel free to email us at tmarksupport\@bizincusa.com
HTML
###############
# FUNCTIONS @@@
###############
sub missing {
print <<"HTML";
Content-type: text/html
Trademark Registration : : Software Error
Site params error!!!
An error occured while parsing, required params. The param "$_[0]" is empty or not defined. Please go back and fill all the required fields.
HTML
}
sub rand_str{
my @chars=('a'..'z','0'..'9');
my $random_string;
foreach (1..$_[0])
{
$random_string.=$chars[rand @chars];
}
return $random_string;
}