Reply
Email Form for Contact Us page
Old 05-18-2009, 11:00 PM Email Form for Contact Us page
Experienced Talker

Posts: 39
Name: April
Trades: 0
I would like an email form to pop up after clicking a link. I browsed some other threads and people were repeatedly saying that the form should be server based and not client based because of bots and other issues. I was wondering if this form should be ASP or something else? I really don't know any code other than html, css, and I understand pre-made javascript codes, but can't write them. Any help on this issue would be most appreciated! I am also not the most familiar with sever-side options, so please be ridiculously thorough haha. THANKS!
mightyjoeape is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 05-20-2009, 03:52 PM Re: Email Form for Contact Us page
Experienced Talker

Posts: 39
Name: April
Trades: 0
Does anyone have any suggestions? I need to get this site finished soon...
mightyjoeape is offline
Reply With Quote
View Public Profile
 
Old 05-20-2009, 05:37 PM Re: Email Form for Contact Us page
stevej's Avatar
Professional Multitasker

Posts: 991
Location: In a flying house
Trades: 0
Well, the people giving advice are right on the server-side issue, but they are, I believe, wrong on the ASP choice. My suggestion: use PHP! A quick Google search will bring up a lot of results, but if you need some code I suppose I could post some as well.

- Steve
__________________
if($stevej == "helpful") { $talkupation += $user_power; }
stevej is offline
Reply With Quote
View Public Profile
 
Old 05-30-2009, 12:14 PM Re: Email Form for Contact Us page
Experienced Talker

Posts: 30
Name: Kulrom
Location: Republic of Macedonia
Trades: 0
As per the popup form it's ok you can use pure html and css but for sending an email you need to submit the form to another page (server-side code) or you can use AJAX (xmlhttp) object to proceed the entries to the server.
Kulrom is offline
Reply With Quote
View Public Profile Visit Kulrom's homepage!
 
Old 06-01-2009, 03:28 AM Re: Email Form for Contact Us page
harish's Avatar
Average Talker

Posts: 26
Name: Harish kumar
Trades: 0
E-mail Form Code (contact.php)

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Email Form </title>
</head>
<body>

 <form method="post" action="sendeail.php">

<!-- DO NOT change ANY of the php sections -->
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>

<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />


Your Name: <br />
 <input type="text" name="visitor" size="35" />
<br />
Your Email:<br />
<input type="text" name="visitormail" size="35" />
 <br /> <br />
  <br />
Attention:<br />
<select name="attn" size="1">
<option value=" Sales n Billing ">Sales n Billing  </option> 
<option value=" General Support ">General Support </option> 
<option value=" Technical Support ">Technical Support </option> 
<option value=" Webmaster ">Webmaster </option> 
</select>
<br /><br />
Mail Message:
<br />
<textarea name="notes" rows="4" cols="40"></textarea>
<br />
<input type="submit" value="Send Mail" />
<br />
Free Code at: <a href="http://www.ibdhost.com/contact/">ibdhost.com/contact/</a>
 </form>
 
</body>
</html>
Code for sendeail.php

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>Sendemail Script</title>
</head>
<body>

 <!-- Reminder: Add the link for the 'next page' (at the bottom)   --> 
<!-- Reminder: Change 'YourEmail' to Your real email  -->  

<?php

$ip = $_POST['ip']; 
$httpref = $_POST['httpref']; 
$httpagent = $_POST['httpagent']; 
$visitor = $_POST['visitor']; 
$visitormail = $_POST['visitormail']; 
$notes = $_POST['notes'];
$attn = $_POST['attn'];
 
 
if (eregi('http:', $notes)) {
    die ("Do NOT try that! ! ");
}
 if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,"."))) 
 {
 echo "<h2>Use Back - Enter valid e-mail</h2>\n"; 
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
echo $badinput;
die ("Go back! ! ");
}

if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<h2>Use Back - fill in all fields</h2>\n";
die ("Use back! ! "); 
 }
        
$todayis = date("l, F j, Y, g:i a") ;

 $attn = $attn ; 
$subject = $attn; 
 
 $notes = stripcslashes($notes); 

 $message = " $todayis [EST] \n
Attention: $attn \n
Message: $notes \n 
From: $visitor ($visitormail)\n
Additional Info : IP = $ip \n
Browser Info: $httpagent \n
Referral :  $httpref \n
";

 $from = "From: $visitormail\r\n";

 
 mail("YourEmail", $subject, $message, $from);

  ?>
    
<p align="center">
Date: <?php echo $todayis ?> 
<br />
Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> ) 
<br />
 
Attention: <?php echo $attn ?>
<br /> 
Message:<br /> 
<?php $notesout = str_replace("\r", "<br/>", $notes); 
echo $notesout; ?> 
<br />
<?php echo $ip ?> 

<br /><br />
<a href="contact.php"> Next Page  </a> 
</p> 

</body>
</html>
harish is offline
Reply With Quote
View Public Profile
 
Old 06-01-2009, 12:19 PM Re: Email Form for Contact Us page
Experienced Talker

Posts: 39
Name: April
Trades: 0
That looks like the code I did use- I was asking specifically about where to find the code that brings up the "apple mail" interface. Thanks.
mightyjoeape is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Email Form for Contact Us page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.13003 seconds with 13 queries