in reply to Re^4: Ajax in perl
in thread Ajax/perl/javascript in perl

To clarify what Corion wrote: your Perl code contains raw HTML. It doesn't work that way, HTML is data and not code. You have to do something with it, likely put it in a string and print it out. For example.

Furthermore, there are errors in here:

$re=$dbh->perpare("select * from table where firstname="$input1" and lasname="input2");
First, it's "prepare", not "perpare". Second, your second parameter should be "$input2" not "input2". Third: you can't just insert double quotes in a doublequotish string, not without backslashes; but fourth: for SQL those should be single quotes instead. And fifth: to guard against SQL injection and just plain errors, use placeholders, not embedded literal values in the SQL!
$re=$dbh->prepare("select * from table where firstname=? and lastname= +?"); $re->execute($input1, $input2);