Error, no image selected.

"); exit; } //check that image is available in the database include("staff/connect.php"); $inum = htmlspecialchars($inum); $checkinum = mysql_query("select count(*) from image where inum = '$inum' and keyadd = 'A'"); $checkinum = mysql_result($checkinum,0,0); if($checkinum<1) { echo("Error

Error, image unavailable.

"); exit; } //get webtitle of the image $title = mysql_query("select webtitle from image where inum = '$inum'"); $title = mysql_result($title,0,0); //this bit will run if submit pressed if($sent) { //check required fields contain info if(!$to || !$from || !$name) { $error = "

Problem sending email.
You must complete the boxes marked with a red asterisk (*) before the email can be sent.

"; unset($sent); } else { //add htmlspecialchars $to = htmlspecialchars($to); $name = htmlspecialchars($name); $from = htmlspecialchars($from); $msg = htmlspecialchars($msg); if($msg) $msg.="\n---\n"; $body = $msg.$name." found the image \"".stripslashes($title)."\" on www.theglasgowstory.com and thought you might like to see it.\n\nClick on the link below to view the image:\n\nhttp://www.theglasgowstory.com/image.php?inum=".$inum."\n\nThis email was sent to you from the www.theglasgowstory.com website."; //send the email mail($to, "TheGlasgowStory: ".stripslashes($title), stripslashes($body), "From: ".$name." <".$from.">"); $success=true; $isip = session_is_registered("userip"); if (!$isip) { session_register("userip"); if (getenv(HTTP_X_FORWARDED_FOR)) $userip=getenv(HTTP_X_FORWARDED_FOR); else $userip=getenv(REMOTE_ADDR); } $now = date(U); $log = mysql_query("insert into accesslog set ip = '$userip', uname = '$user', logdate = '$now', actiontype = 'Email to Friend', details = '$inum'"); //now record sent info in DB $insert = mysql_query("insert into imagemail set to_mail = '$to', from_name = '$name', from_mail = '$from', msg = '$msg', inum = '$inum', sentdate = '$now'"); if($success==true) { ?> Your Email has been sent TheGlasgowStory -- Email <?echo(stripslashes($title));?> to a friend

Thank You!

Your email has been sent to "".

Close Window

Problem sending email.
Unable to send your email at the moment. Please try again.

"; unset($sent); } } } if(!$sent) { ?> Email Image to a Friend TheGlasgowStory -- Email <?echo(stripslashes($title));?> to a friend

Email "" to a friend

To:  
*Email Address:
Your Details:  
*Your Name:
*Email Address:
Message:

TheGlasgowStory will not pass your e-mail address on to any other organisation or send you any unsolicited e-mails.