
if ($action == "view") { ?>
} else { ?>

} ?>
|
|
|
if ($action == "create") {
if (isset($_GET['imageid'])) $imageid = $_GET['imageid'];
$images = mysql_query("SELECT image.*, category.categorytitle FROM image, category, image2category WHERE image.imageid = $imageid AND image.imageid = image2category.imageid AND category.categoryid = image2category.categoryid");
if($image = @mysql_fetch_array($images)) {
$imagepath = $imagedir.$image['categorytitle'].'/'.$image['path'];
if (strlen($image['path']) > 3) {
?>
} else {
echo "invalid image";
}
} else {
echo "invalid image";
}
} else if ($action == "preview") {
$imagepath = $_POST['imagepath'];
$imageid = $_POST['imageid'];
?>
}
if ($action == "goodtosend") {
mysql_query("INSERT INTO card (proof,recipientemail,sendername,senderemail,imageid,timestamp) VALUES ('$proof','$recemail','$yourname','$youremail','$imageid','$timestamp')");
$id = mysql_insert_id();
$sendname = stripslashes($yourname);
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: php\n";
$headers .= "From: \"".$sendname."\" <".$youremail.">\n";
$subject = $sendname." has sent you a card";
$message = $sendname." (".$youremail.") has sent you an e-card from the Space Weather Center.\n\n";
$message .= "Follow this link to view your card:\nhttp://www.spaceweathercenter.org/ecard/01/ecard.php?action=view&id=".$id."&proof=".$proof."\n\n";
$message .= "The Space Weather Center (www.spaceweathercenter.org) includes games, activities, and information on the Sun, plasmas, and the effects of space weather on Earth. From the Space Science Institute (www.spacescience.org), with support from the National Science Foundation and NASA.";
@mail($recemail, $subject, $message, $headers);
$extra = "";
?>
} else if ($action == "view") {
$proof = isset($_GET['proof']) ? $_GET['proof'] : 0;
$id = isset($_GET['id']) ? $_GET['id'] : 0;
if (file_exists("ecards/card".$id."_".$proof.".xml")) {
?>
} else {
?>
We're sorry, seems that the card you are trying to access does not exist.
explore space weather
}
} else if ($action == "repeat") {
?>
This card was already sent in the last minute. Please try again later if you wish to resend it.
back to gallery
}
?>
|
|