Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


 
 
LinkBack Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 05-10-2008, 04:24 PM   #1 (permalink)
Junior Member
 
Join Date: 05-07-08
Posts: 16
iTrader: 0 / 0%
Latest Blog:
None

gordon is liked by many
Need help with contact form

I have added a contact form to my site and it seems to be working. What I would like to do know, is add some type of feature were an individual is limited on the number of times they can submit my form over a given time interval(lets say five minutes).

Below you will find my contact form and contact.php file.

Code:
contact form <form id="form" method="post" action="contact.php" enctype="multipart/form-data" name="form"> <strong><u>All fields marked * are required</u></strong> <br /><br style="line-height:15px;" /> <div class="col_box"> <div class="col_box_1"> <strong>Subject</strong> <div class="t_form"><input name="content" type="text" value="" /></div> <strong>Name *</strong> <div class="t_form"><input name="visitor" type="text" value="" /></div> <strong>Email *</strong> <div class="t_form"><input name="visitormail" type="text" value="" /></div> <br /><br style="line-height:3px;" /> <strong><a href="http://www.***.com/verification.html" onclick="window.open('http://www.***.com/verification.html','popup','width=400,height=500,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false">whats this?</a></strong>*<img src="captcha.php"><input type="text" name="vercode" value="Place above code here" /><br> </form> </div> <div class="col_box_2"> <strong>Message *</strong> <textarea name="details" cols="2" rows="2" ></textarea> <strong style="margin:0 15px 0 40px;"> <input type="submit" name="submit" value="Submit"><input type="reset" name="Submit2" value="Reset"> </div> <div class="clear"></div> </div> </form> </div>
Code:
contact.php file <?php $content = $_POST['content']; $visitor = $_POST['visitor']; $visitormail = $_POST['visitormail']; $details = $_POST['details']; if (eregi('http:', $details)) { die ("We don't allow visitors to submit website links due to security reasons, Please click the browser back button and remove the link."); } if(empty($visitor) || empty($visitormail) || empty($details )) { echo "<h2>Use the browser back button and fill in all required form fields</h2>\n"; die (""); } if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,"."))) { echo "<h2>Use browser back button and enter a valid e-mail address</h2>\n"; $badinput = "<h2>A valid email looks like this: someone@someone.com</h2>\n"; echo $badinput; die (""); } session_start(); if ($_POST["vercode"] != $_SESSION["vercode"] OR $_SESSION["vercode"]=='') { echo "<h2>Use browser back button and enter the correct verification code.</h2>\n"; die (""); } $todayis = date("l, F j, Y") ; $content = $content ; $subject = $content; $details = stripcslashes($details); $message = " $todayis \n Subject: $content \n Message: $details \n From: $visitor ($visitormail)\n "; $from = "From: $visitormail\r\n"; mail("email@email.com", $subject, $message, $from); ?> <p align="center"> Date: <?php echo $todayis ?> <br /> Email was recieved - Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> ) <br /> Subject: <?php echo $subject ?> <br /> Message:<br /> <?php $notesout = str_replace("\r", "<br/>", $details); echo $notesout; ?> <br /> <br /><br /> <a href="contactus.html"> Back to contact page </a> </p>
Any help would be greatly appreciated.

If you also notice anything else that can be added or changed please let me know

Thanks

Last edited by gordon; 05-10-2008 at 04:36 PM..
gordon is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need a contact form for my web site iorgyzu88 Coding Forum 10 03-17-2007 06:56 PM
Wordpress Contact Form casperl Blogging Forum 1 02-25-2007 04:00 PM
Contact form issues RonHollingsworth Coding Forum 1 02-08-2007 08:54 AM
Contact Form and Go To Url Question popstalin Coding Forum 2 02-07-2007 10:36 AM
Help me with a better contact form andreeam Coding Forum 4 11-18-2006 01:56 PM


Sponsor Links
Get exposure! Contextual Links V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 01:33 PM.
© Copyright 2008 V7 Inc
Powered by vBulletin
Copyright © 2000-2009 Jelsoft Enterprises Limited.


Search Engine Optimization by vBSEO 3.3.0 ©2009, Crawlability, Inc.