AZooNYcards
We will keep your AZooNYcard active in our system for 30 days.");
table3("Send an AZooNYcard to your friends and family!");
echo "
";
//*************************************// End Middle HERE!! //********************************************//
bottom('2');
}
//*************************************// MAIN //********************************************//
open_databases();
if (isset($card)) {
page_top('2','AZooNY.com AZooNYcard Postcard');
//echo "card is: $card
";
echo "
";
$eval = "select * from azoonycards where azoonycard_number=\"$card\"";
// echo "
selected field is: $eval";
$record = mysql_query("$eval");
if (!$record) {
emsg("We failed to find your postcard! Please contact support@azoony.com");
closeout(); exit(); }
$row = mysql_fetch_array($record);
if (mysql_num_rows($record) < 1) {
emsg("Unable to find AZooNYcard: $card");
closeout(); exit(); }
$azoonycard_msg = stripslashes(nl2br($row["azoonycard_msg"]));
$azoonycard_from = $row["azoonycard_from"];
$piece_master_id = $row["piece_master_id"];
$azoonycard_to = $row["azoonycard_to"];
$eval = "select * from piece where piece_master_id=\"$piece_master_id\"";
$record = mysql_query("$eval");
if (!$record) {
emsg("Unable to fetch image piece record.");
closeout(); exit(); }
$prow = mysql_fetch_array($record);
$piece_image1 = $prow["piece_image1"];
$artist_id = $prow["artist_id"];
$piece_title = $prow["piece_title"];
$eval = "select home_directory from artists where artist_id=\"$artist_id\"";
$record = mysql_query("$eval");
if (!$record) {
emsg("Unable to fetch image directory information.");
closeout(); exit(); }
$arow = mysql_fetch_array($record);
$home_directory = $arow["home_directory"];
echo "
";
echo "";
echo " "; echo colorlogo_card(1); echo " ";
echo "\n
";
echo " $piece_title ";
echo " You've been sent an AZooNYcard from: $azoonycard_from ";
echo "
$azoonycard_msg
";
echo "\n |
";
$eval = "update azoonycards set azoonycard_viewed=NOW() where azoonycard_number=\"$card\"";
// echo "
updated field is: $eval";
$record = mysql_query("$eval");
if (!$record)
emsg("Unable to mark your card as read.");
/////////////////// send confirmation to from /////////////////
$str="Your AZooNYcard has been received by $azoonycard_to
-AZooNY";
$subject = "AZooNYcard Received";
$sendto = "$azoonycard_from";
$header = "From: azoony@azoony.com";
if (EMAIL == "1")
mail ($sendto, $subject, $str, $header);
else echo "
mail ($sendto, $subject, $str, $header);
";
closeout();
exit();
}
page_top('2','AZooNY.com Send an AZooNYcard (An art electronic Postcard)');
if (isset($submit)) {
// Stop the form being used from an external URL
// Get the referring URL
$referer = $_SERVER['HTTP_REFERER'];
// Get the URL of this page
$this_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER["REQUEST_URI"];
// If the referring URL and the URL of this page don't match then
// display a message and don't send the email.
if ($referer != $this_url) {
emsg("Unable to send from another URL (if you happened used the back key of your browser please start over).");
bottom('2');
exit;
}
//check if spam material
$eval = "select * from azoonycards where azoonycard_created > date_sub(now(), interval \"16:1\" minute_second)";
$record = mysql_query("$eval");
if (!$record) {
emsg("Our email spam check flaged this! Or something may be wrong with our system... please try again later..");
closeout();
exit();
}
if (mysql_num_rows($record) > 4) {
emsg("To protect against email spamming, our system does not allow you to send AZooNYcards this often.
Sorry about that, we hope you will try again later");
closeout();
exit();
}
$eval = "insert into azoonycards set piece_master_id=\"$piece_master_id\", azoonycard_msg=\"$azoonycard_msg\",
azoonycard_to=\"$azoonycard_to\", azoonycard_from=\"$azoonycard_from\", azoonycard_created=NOW()";
// echo "added field is: $eval";
$record = mysql_query("$eval");
if (!$record)
emsg("We failed to process your postcard! Please contact support@azoony.com");
// $eval = "select azoonycard_number from azoonycards where auto is NULL";
$eval = "select last_insert_id()";
$record = mysql_query("$eval");
if (!$record) {
emsg("We failed to fetch your unique azoonycard number! Please contact support@azoony.com");
closeout();
exit();
}
$azoonycard_record = mysql_insert_id();
// list($usec, $sec) = explode(' ',microtime());
// $seed = (float) $sec + ((float) $usec * 100000);
// mt_srand($seed);
//echo "
ranmax is:"; echo getrandmax();
$azoonycard_number= "$azoonycard_record".mt_rand(1, 32767).mt_rand(1,32767);
$eval = "update azoonycards set azoonycard_number=\"$azoonycard_number\" where azoonycard_record=\"$azoonycard_record\"";
// echo "update field is: $eval";
$record = mysql_query("$eval");
if (!$record)
emsg("We failed to process your postcard fetch number! Please contact support@azoony.com");
///////////////// sending email to recipiant ////////////////////
$str="A special AZooNYcard (postcard) has been sent to
you by $azoonycard_from.
Your AZooNYcard will be held for 30 days before it expires.
You can pick it up from AZooNY.com at:
http://azoony.com
Your AZooNYcard number is: $azoonycard_number
Or just go to this link below:
http://azoony.com/azoonycards/?card=$azoonycard_number
-AZooNY";
$subject = "AZooNYcard sent by $azoonycard_from";
$sendto = "$azoonycard_to";
$header = "From: azoony@azoony.com";
if (EMAIL == "1")
mail ($sendto, $subject, $str, $header);
else echo "
mail ($sendto, $subject, $str, $header);
";
echo "\n
Your message was Sent!
";
echo "\n
";
echo "\n
Back to Homepage
";
closeout();
exit();
}
///////////////////////////////////////////////////////////////////////////////////
if (isset($verify_fields)) {
$dirty = 0;
if ($azoonycard_to == null)
{ $empty[1] = 1; $dirty++; }
else
// { $azoonycard_to = mrclean($azoonycard_to);
if (strlen($azoonycard_from) > 50)
{ $empty[1] = 2; $dirty++; }
// else {
// $f_email = strtolower(trim($azoonycard_to));
// if (!is_valid_email($f_email))
// { $empty[1] = 3; $dirty++; }
// }
if ($azoonycard_from == null)
{ $empty[2] = 1; $dirty++; }
else
// { $azoonycard_from = mrclean($azoonycard_from);
if (strlen($azoonycard_from) > 30)
{ $empty[2] = 2; $dirty++; }
else {
$f_email = strtolower(trim($azoonycard_from));
if (!is_valid_email($f_email))
{ $empty[2] = 3; $dirty++; }
}
if ($azoonycard_msg == null)
{ $empty[3] = 1; $dirty++; }
if (word_filter($azoonycard_msg))
{ $empty[3] = 3; $dirty++;
emsg("%Inappropriate words detected in AZooNYcard from: $azoonycard_from to $azoonycard_to");
}
if (mrclean2($azoonycard_msg,512))
{ $empty[3] = 2; $dirty++; }
if ($dirty == "0") {
//echo "
before:$azoonycard_msg
";
// $azoonycard_msg = htmlspecialchars($azoonycard_msg, ENT_QUOTES);
//echo "
after:$azoonycard_msg
";
echo "
";
closeout();
exit();
}
else $send = "set";
//echo "
was not clean...
";
}
if (isset($send)) {
if (($send != " Change this Card ") && !isset($verify_fields)) {
// if (!isset($verify_fields) && !isset($submit)) {
$azoonycard_to = "";
$azoonycard_msg = "";
$azoonycard_from = "";
}
echo "";
closeout();
exit();
}
echo "
";
echo "";
echo "
Send An Artwork Image";
echo "
Pick an art image from our catalog.
Look for the button:
| ";
echo "
Your greeting will go here!";
echo "\n
Visit an Aritist's AZooNY home page and send an "; echo colorlogo_card(1); echo " of an artwork image to a friend!";
echo "\n
|
";
closeout();
exit();