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
Old 03-06-2010, 07:32 PM Check before Submit
Skilled Talker

Posts: 65
Name: Tony Connelly
Location: Scotland
Trades: 0
Need some help!

Been away doing a big fibre job and heading off again tomorow so thought I would ask this before I go and I will hopfully pick up some replies next week when I'm back.

I have been using your tips and replies to good effect to get my review submission section of my site off the ground. Its fairly simple as I'm learning the php as I go and with help from other people wo have the same interest (guitars) they have now started to add some reviews.

I have been hit twice now by spam ie some sort of bot or something that has automatically added reviews with linke etc and I have to go to my database and delete them. Is there any simple code you code suggest to put some sort of chek before the reviewer hits submit on my form. my review section is at http://www.guitarandsong.com/links.htm and where I notice the added ones is at http://www.guitarandsong.com/user-reviews.php

Hope you can all help a newbie to php. I'm looking for something simple but effective. Even a suggested site where I could learn about this would help, thanks
__________________

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


Please login or register to view this content. Registration is FREE
connelly73 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-06-2010, 08:54 PM Re: Check before Submit
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
I think what you're thinking of is a Captcha. This is the one I use: http://recaptcha.net/
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 03-06-2010, 11:44 PM Re: Check before Submit
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
Most simple and effective way to protect from bots is to add a hidden field with sensible name to your form which a bot will most likely fill with some random data and a human will not. Of course, this will not help against specialized bots customized for your site.
__________________

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

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 03-07-2010, 03:51 AM Re: Check before Submit
MattGoucher's Avatar
Skilled Talker

Posts: 64
Name: Matt
Location: California
Trades: 0
@Connelly73
You have a really bad bug with the register. I just managed to post a completely blank guitar review (sorry about that). But basically, You need to check the values before adding them to the database. The simplest way to do so without CAPTCHA, is either to create a function to check:

PHP Code:
<?php
    
function clean($String){
        
// This Is The Function That Is Going To Clean Your Strings
        
$A stripslashes($String); // Get Rid of PHP Killing Slashes
        
$C strip_tags($A); // Strip HTML Tags </>
        
$B mysql_real_escape_string($C); // Sanitize Overall
        
return $B// Give Back The SAFE String
    
}
    
$Submit_Button $_POST['submit'];
    if(
$Submit_Button){
        
// If They Press The Button:
        
$Title clean($_POST['Title']); // Get The Title
        
$Brand clean($_POST['Brand']); // Get The Brand
        
$Build clean($_POST['Build']); // Get The Build
        
$Function clean($_POST['Function']); // Get The Function
        
if($Title&&$Brand&&$Build&&$Function){
            
$Query mysql_query("INSERT INTO....");
            if(!
$Query){
                die(
"Sorry Somthing Went Wrong");
            }else{
                die(
"Your Data Has Been Sent And Inserted Into The Database");
            }
        }else{
            die(
"You Did Not Enter All Values"); // Kill Script
        
}
    
    }
?>
__________________

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

Invalid Code On A New Website Is Like Having A New Car With A Broken Windshield
MattGoucher is offline
Reply With Quote
View Public Profile Visit MattGoucher's homepage!
 
Old 03-12-2010, 07:13 PM Re: Check before Submit
Skilled Talker

Posts: 65
Name: Tony Connelly
Location: Scotland
Trades: 0
Thanks Guys
Just back so will give these ideas a try over the weekend and post back if any problems.

Cheers
__________________

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


Please login or register to view this content. Registration is FREE
connelly73 is offline
Reply With Quote
View Public Profile
 
Old 03-14-2010, 06:56 PM Re: Check before Submit
Skilled Talker

Posts: 65
Name: Tony Connelly
Location: Scotland
Trades: 0
Thanks guys. Used the recaptcha link and it works a treat.

Cheers
__________________

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


Please login or register to view this content. Registration is FREE
connelly73 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Check before Submit
 

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