Advertisement  
 
Main Menu
Login
Recent Forum Posts
 Friday, 21 November 2008
BostonPHP Forum  


Under attack... - 2008/08/05 00:56 Hi everyone,

I have a site live for a few weeks now and within the past couple of days I have gotten over 1000 "blank" emails from the web
site's contact form. This web site is political in nature and that may
explains the motives of the attacker/s.

The truth is that I don't even know how the person or people can even
circumvent the "validate" function.

I have started to look for a more robust approach (I have limited PHP experience) for the contact form and found a couple of leads which URL's I include bellow.

In both of those cases however, it seams that I would have to spend an unknown amount of time learning and testing and I don't know even if any of those options will do the job.

Any suggestions/ideas?

Thank you very much.

Goyo

These are links to the two options I found and bellow the code I am
currently using for the form and PHP:

http://www.safalra.com/programming/php/contact-feedback-form/
http://articles.techrepublic.com.com/5100-10878_11-6078577.html

Code:

<form name="membership" action="membership_receipt.php" method="POST" enctype="multipart/form-data" onsubmit="return validate();">
<p>Name:<br /><input class="text_field" name="name" type="text" size="35" /></p><br />
<p>Street:<br /><input class="text_field" type="text" size="35" name="street" /></p><br />
<p>City:<br /><input class="text_field" type="text" size="35" name="city" /></p><br />
<p>State:<br /><input class="text_field" name="state" type="text" size="35" /></p><br />
<p>Zip Code:<br /><input class="text_field" type="text" size="8" name="zip" /></p><br />
<p>Phone Number:<br /><input class="text_field"name="phone" type="text" size="20" /></p><br />
<p>Email:<br /><input class="text_field"name="email" type="text" size="35" /></p><br />
<p>Your Message (optional, but welcome!)<br />
<textarea class="text_field" name="comment" cols="35" rows="5"></textarea></p>

<div id="submit_butt">
<p>Click once to submit  <input class="submit_field" type="submit" value="Submit"/></p>
</div><!--ends submit_but-->

</form>


///////////////////////


<?php


$name = $_POST['name'];
$street = $_POST['street'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$comment = $_POST['comment'];

$email_owner = "join@somename.org";

$subject_owner = "E-mail from somename Join Page";

$content_owner = "Personal Information: " . "nn" . "Name: " . $name . "nn" . "Street: " . $street . "nn" . "City: " . $city . "nn" . "State: " . $state . "nn" . "Zip Code: " . $zip ."nn" . "Phone Number: " . $phone . "nn" . "Email: " . $email . "nn" . "Comment: " . $comment;

$send_owner = mail("$email_owner","$subject_owner","$content_owner");?>
  | | The administrator has disabled public write access.
Show your support
Polls
What's the average PHP rate in Boston
 
What's the PHP rockstar rate in Boston
 
Tag Cloud
Podcast
The BostonPHP podcast Podcast
Full Feed
 
Go to top of page  Home | Wiki | Search | Forums | Job Board | Newsletter | Latest News | Reservations | Classified Ads | Podcast Archive | MyAccount |