Jump to content


Photo

Old Internal Mail system


  • Please log in to reply
1 reply to this topic

#1 Otto2

Otto2

    Etomite Forum Newbie

  • Member
  • 36 posts

Posted 01 October 2009 - 08:44 PM

Hi all..
Years ago i found a internal mail system code and implemented as a contact form.
I thought i found it here, so i was looking if there was any update with some captcha in it? Or maybe a updated but simple form with works with the Message-service in My Etomite itselves?

Thanks in advance,


// --------- internal Message System ------------
$userid = 1;

// English

$msg['require'] = "<fieldset><legend>Please fill out all the required fields.</legend></fieldset>";
$msg['send_success'] = "<fieldset><legend>Message successfully sent.</legend></fieldset>";
$msg['send_error'] = "<fieldset><legend>An error occurred, the message could not be sent.</legend></fieldset>";
$msg['form_name'] = "<b>Your phonenumber:</b>";
//$msg['form_email'] = "<b>Your e-mail address:</b>";
$msg['form_subject'] = "<b>Your email address:</b>";
$msg['form_msg'] = "<b>Your requested info:</b>";
$msg['form_submit'] = "Submit";
$msg['form_reset'] = "Reset";

/*
// German
$msg['require'] = "Bitte füllen Sie alle erforderlichen Felder aus.";
$msg['send_success'] = "Nachricht erfolgreich gesendet.";
$msg['send_error'] = "Es trat ein Fehler auf, die Nachricht konnte nicht gesendet werden.";
$msg['form_name'] = "Ihr Name:";
$msg['form_email'] = "Ihre E-Mail-Adresse:";
$msg['form_subject'] = "Titel der Nachricht:";
$msg['form_msg'] = "Ihre Nachricht:";
$msg['form_submit'] = "Abschicken";
$msg['form_reset'] = "Reset";
// ---------------------------------------------------
// only edit below if u know what u r doing!
// ---------------------------------------------------
*/

$r = '';
$show_form = true;
if( $_POST['send'] == 'true' )
{
	$name = addslashes($_POST['name']);

	$postdate = time();
	$subject = addslashes($_POST['subject']);
	$message = addslashes($_POST['message']);
	
	if( ($name == '') OR ($message == '') OR ($subject == '') )
	{
		$r .= "<p class='msg_error'>".$msg['require']."</p>";
	}
	else
	{
		$sql = "INSERT INTO ".$GLOBALS['dbase'].".".$GLOBALS['table_prefix']."user_messages(recipient, subject, message, postdate,  type)
				values($userid, ' : $subject', '$name, $email,  Vraagt : <p />$message', $postdate, 'Message');";
		$rs = mysql_query($sql);
		
		if( $rs ) 
		{
			$r .= "<p class='msg_success'>".$msg['send_success']."</p>";
			$show_form = false;
		}
		else
			$r .= "<p class='msg_error'>".$msg['send_error']."</p>";
	}
} 

if( $show_form )
{
	$r .= "<div class='msg_form'>
			<form method='post' action='' class='prettyform'>
			<input type='hidden' name='send' value='true' />
			
			<label for='name'>".$msg['form_name']."<span class='msg_req'></span></label> <br>
			<input type='text' id='name' name='name' value=\"".$name."\" size=\"30\" />
			<br class=\"clear\" /><p>
			
               


			<label for='subject'>".$msg['form_subject']."<span class='msg_req'></span></label> <br>
			<input type='text' name='subject' id='subject' value=\"".$subject."\" size=\"30\" />
			<br class=\"clear\" /> <p>

			
			<label for='message'>".$msg['form_msg']."<span class='msg_req'></span></label> 
			<textarea cols='60' rows='5' id='message' name='message'>".$message."</textarea>
			<br class=\"clear\" />
			
			<div class='submit'><input type='submit' value='".$msg['form_submit']."' class='button' />
			<input type='reset' value='".$msg['form_reset']."' class='button'  /></div>
		</form>
	</div>\n";
}

return $r;



#2 Ralph

Ralph

    Loves Etomite Forums!

  • Admin
  • 6,539 posts

Posted 02 October 2009 - 12:00 AM

Implementing CAPTCHA should be fairly straight-forward... I should have at least one tutorial on my site at http://dahlgren.slyip.com if you'd like to take a look... There are also several Snippets that might provide some ideas...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users