Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP form and getting spammed
Old 10-19-2007, 07:37 AM PHP form and getting spammed
Super Talker

Posts: 113
Trades: 0
I have a contact form using PHP

Off late i am getting spammed its like someone types in name address and then some message and gets sent to me and im like geting 10ish per day! Is their anyhow i can stop it? im thinking its computer generated rather than someone typing it up...

i am not sure what information ill need to give you guys so please feel free to tell me what i need to supply

thanks
checkmate is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-19-2007, 07:39 AM Re: PHP form and getting spammed
hamesy's Avatar
Webmaster Talker

Posts: 639
Name: Steve
Location: Birmingham, England
Trades: 0
If you find the IP address of the person/bot sending you the messages, you can always block that.

I had a simliar problem a while back, and thats how I resolved it. But there might be a better way to do it.
__________________
Hamesy

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
hamesy is offline
Reply With Quote
View Public Profile
 
Old 10-19-2007, 08:52 AM Re: PHP form and getting spammed
Average Talker

Posts: 17
Trades: 0
If you wish to use formmail script then you can find few good scripts at :

verysimple.com
__________________
RSHosting- UK & US based reseller & dedicated hosting.
100% anonymous reseller hosting
+ FFMPEG + 10 min support

Please login or register to view this content. Registration is FREE
rshosting is offline
Reply With Quote
View Public Profile
 
Old 10-19-2007, 09:49 AM Re: PHP form and getting spammed
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
Take a look at the folowling post:

http://www.webmaster-talk.com/php-fo...-top-tips.html

It covers some good php based ways to protect yourself.
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 10-19-2007, 02:34 PM Re: PHP form and getting spammed
Inet411's Avatar
Skilled Talker

Posts: 88
Name: programmer
Location: internet
Trades: 0
Quote:
Originally Posted by checkmate View Post
I have a contact form using PHP

Off late i am getting spammed its like someone types in name address and then some message and gets sent to me and im like geting 10ish per day! Is their anyhow i can stop it? im thinking its computer generated rather than someone typing it up...

i am not sure what information ill need to give you guys so please feel free to tell me what i need to supply

thanks

You need some form of captcha to make sure a human and not a robot is submitting the form.
Checkmate I've made a little demo script for you:
http://www.inet411.com/demos/checkmate.php

You can get the code here:
http://www.inet411.com/demos/verify.txt

If that works for you let me know. If you can't figure out how to implement it, just post your code here and I'll integrate into it for you.

Regards,
Inet411 is offline
Reply With Quote
View Public Profile Visit Inet411's homepage!
 
Old 10-25-2007, 09:37 AM Re: PHP form and getting spammed
Super Talker

Posts: 113
Trades: 0
Hi their

I liked the above

can you please help me add it in? I have my script below for you

thanks in advance!

Quote:
<form action="Thankyou.php" method="post">
<span class="white_text"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> Your Name :
<input type="text" name="name" />
<br />
<br />
Your E-Mail :
<input type="text" name="email" />
<br />
<br />
Message :<br />
<textarea name="message" cols="35" rows="7"></textarea>
<br />
<br />
<input name="submit" type="submit" value="Send" />
</font> </span>
</form>
checkmate is offline
Reply With Quote
View Public Profile
 
Old 10-25-2007, 12:04 PM Re: PHP form and getting spammed
Inet411's Avatar
Skilled Talker

Posts: 88
Name: programmer
Location: internet
Trades: 0
Hope this helps:

PHP Code:
<?
session_start
();
//----------------------------------------
//#This is the Page with form
//----------------------------------------
$number1 rand(1,4);
$number2 rand(1,4);
$_SESSION['answer'] = $number1 $number2;
?>
<form action="Thankyou.php" method="post">
<span class="white_text"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> Your Name :
<input type="text" name="name" />
<br />
<br />
Your E-Mail :
<input type="text" name="email" />
<br />
<br />
Message :<br />
<textarea name="message" cols="35" rows="7"></textarea>
<br />
<br />
Perform this simply math problem to prove you are human :<br />
<?echo"$number1 + $number2 = ";?>
<input type="text" name = "uanswer">
<br />
<br />
<input name="submit" type="submit" value="Send" />
</font> </span>
</form> 
 
 
//Above is the contact page, below is the thankyou page
 
<?
session_start
();
//----------------------------------------
//#This is the Thank you page
//----------------------------------------
if (($_POST['uanswer']) && ($_POST['uanswer'] != $_SESSION['answer'])) {
echo (
"<p align=center>Wrong answer Please try again!</p>");
} else {
//put whatever you want here after a form is submitted
}
?>
Inet411 is offline
Reply With Quote
View Public Profile Visit Inet411's homepage!
 
Old 10-25-2007, 07:52 PM Re: PHP form and getting spammed
Skilled Talker

Posts: 55
Name: Mike
Trades: 0
One way to stop it if its a bog is to put a hidden input that remains empty. You then use php and check to see if that field is empty and if it is then its a person and not a bot. A bot would put something in it (depending on the name of it).
XBSHX is offline
Reply With Quote
View Public Profile
 
Old 10-26-2007, 06:05 AM Re: PHP form and getting spammed
Skilled Talker

Posts: 81
Trades: 0
On our contact form, I really did not want to sue captcha, as research shows some people are put off by it. Each field is checked for stuff like bcc: cc: to: < >, commas in the senders email field. In addition, there is a hidden (supposed name) field which if a spambot enters anything, the email is rejected. Since adding these features, we have had no spam at all, and I also believe it is impossible for the form to be hijacked to send to anyone else.

Best wishes

Tony
soon is offline
Reply With Quote
View Public Profile Visit soon's homepage!
 
Old 10-26-2007, 10:18 AM Re: PHP form and getting spammed
Foundationflash's Avatar
Ultra Talker

Posts: 410
Name: Harry Burt
Location: Colchester, Essex, England
Trades: 0
I don't think people are put off by CAPTCHAs - though like all good changes, people might take a while to get used to them. I'd be interested to see the research though.
__________________
Foundation Flash tutorials :
Please login or register to view this content. Registration is FREE


New Dreamed Up Web Design:
Please login or register to view this content. Registration is FREE
Foundationflash is offline
Reply With Quote
View Public Profile Visit Foundationflash's homepage!
 
Reply     « Reply to PHP form and getting spammed
 

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.94553 seconds with 12 queries