#!/usr/local/bin/perl
require "weblib.lib";
require "/home/todd/toddweb.env";
if(!$ENV{CONTENT_LENGTH}){
	&htmlopen("Liars Contest");
	print <<EOF;
<img src="http://TRConnection.com/pictures/covers/liarsusuk.jpg" align="left" width="190" height="188">
Sanctuary Records Group is making two "Liars" CDs available for giveaway to lucky (and knowledgeable) fans through the TR Connection. All you have to do to enter is to answer correctly these four questions (the answers are buried somewhere in the TR Connection web site). Two names will then be drawn from the correct entries. The CDs will be awarded on Monday, April 5, 2004. Entries must be received by 12:00 PDT Monday, April 5 to qualify. One entry per person, please. Duplicate and late entries will be discarded.
<p>
1) What is your name?<br>
2) What is your quest?<br>
<p>
Oops, wrong era. Let's try again
<br clear="left">
<form action="http://TRConnection.com/todd/contest" method="POST">
<table>
<tr><td>1) Who besides Todd appears on the "Liars" CD?</td><td><input name="q1" size="40"></td></tr>
<tr><td>2) What date will Todd and the Liars appear in London, England?</td><td><input name="q2" size="40"></td></tr>
<tr><td>3) What promotional single has been selected from "Liars?"</td><td><input name="q3" size="40"></td></tr>
<tr><td>4) Which radio personality premiered the song "Happy Anniversary?"</td><td><input name="q4" size="40"></td></tr>
<tr><th align="left">Your Name</th><td><input name="realname" size="30"></td></tr>
<tr><th align="left">Your E-mail address</th><td><input name="email" size="30"></td></tr>
</table>
<input type="checkbox" name="OK"> It's OK to send my e-mail address to Sanctuary for future promotions/information
<br>(if left unchecked, your e-mail address will be used for the purpose of this contest only, and will only be available to the TR Connection.)
<p><input type="submit" value="Enter Contest">
</form>
EOF
}
else{
	&ReadParse;
	$message=<<EOF;
To: TRContest\@TRConnection.com
From: "$in{realname}" <$in{email}>
Subject: Liars Contest

1) Who besides Todd appears on the "Liars" CD? $in{q1}
2) What date will Todd and the Liars appear in London, England? $in{q2}
3) What promotional single has been selected from "Liars?" $in{q3}
4) Which radio personality premiered the song "Happy Anniversary?" $in{q4}

EOF
	if($in{OK}){$message.="You have permitted your e-mail address to be shared with Sanctuary Records Group.";}
	else{$message.="Your e-mail address will not be shared with anyone.";}
	($display=$message)=~s/</&lt;/g;
	$display=~s/\n/<br>\n/g;
	if($in{email} && $in{realname} && $in{q1} && $in{q2} && $in{q3} && $in{q4}){
		open(MAIL,"|/usr/sbin/sendmail TRContest\@TRConnection.com");
		print MAIL $message;
		close MAIL;
		&htmlopen("Thanks!");
		print <<EOF;
<img src="/pictures/covers/liarsusuk.jpg" align="left" width="190" height="188">
Your contest entry has been submitted.<br>
Watch the TR Connection on Monday, April 5, 2004 for the announcement of the winners.
<hr>$display
EOF
	}
	else{
		&htmlopen("Sorry!");
		$checked=$in{OK}?" checked":"";
		print <<EOF;
<img src="/pictures/covers/liarsusuk.jpg" align="left" width="190" height="188">
Your contest entry was not submitted because it was incomplete. Please try again.
<form action="http://TRConnection.com/todd/contest" method="POST">
<table>
<tr><td>1) Who besides Todd appears on the "Liars" CD?</td><td><input name="q1" size="40" value="$in{q1}"></td></tr>
<tr><td>2) What date will Todd and the Liars appear in London, England?</td><td><input name="q2" size="40" value="$in{q2}"></td></tr>
<tr><td>3) What promotional single has been selected from "Liars?"</td><td><input name="q3" size="40" value="$in{q3}"></td></tr>
<tr><td>4) Which radio personality premiered the song "Happy Anniversary?"</td><td><input name="q4" size="40" value="$in{q4}"></td></tr>
<tr><th align="left">Your Name</th><td><input name="realname" size="30" value="$in{realname}"></td></tr>
<tr><th align="left">Your E-mail address</th><td><input name="email" size="30" value="$in{email}"></td></tr>
</table>
<input type="checkbox" name="OK"$checked> It's OK to send my e-mail address to Sanctuary for future promotions/information
<br>(if left unchecked, your e-mail address will be used for the purpose of this contest only, and will only be available to the TR Connection.)
<p><input type="submit" value="Enter Contest">
</form>
EOF
	}
}
print qq{<br clear="left">\n};
print $PAGETAIL;
&htmlclose;
