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-07-2010, 08:32 PM Sanitizing input
Junior Talker

Posts: 4
Trades: 0
I'm not exactly sure if this is the right place to put this, as it's about both PHP and SQL, but I think it fits best here. I have a "shoutbox" on my site and am worried about people hitting me with an SQL/JS/PHP injection. To counter JS and PHP injections, I'm adding "<i></i>" after every <. Probably not the best way to do it, but it works. To counter an SQL injection, I'm using the addslashes function, which is supposed to protect from this. Unfortunately, this causes a long delay between shouting and the shout showing up. Any suggestions? Is this just something I'll have to accept? (That's fine if it is.)
__________________
A tautology is something that behaves in a tautological fashion.
Biophysicist is offline
Reply With Quote
View Public Profile Visit Biophysicist's homepage!
 
 
Register now for full access!
Old 03-08-2010, 01:20 AM Re: Sanitizing input
Knight13's Avatar
Defies a Status

Posts: 10,289
Name: Knight13
Location: Cleveland, Ohio
Trades: 0
Use strip_tags() to strip out all the tags that someone would put into your shout box. here is a link to learn about them.

http://www.php.net/manual/en/function.strip-tags.php
Knight13 is offline
Reply With Quote
View Public Profile
 
Old 03-09-2010, 04:56 AM Re: Sanitizing input
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
You'll also want to check out the links on this sticky: http://www.webmaster-talk.com/php-fo...rials-how.html
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 03-09-2010, 05:04 AM Re: Sanitizing input
lynxus's Avatar
Awesomeo-Maximo

Posts: 1,618
Location: UK
Trades: 1
to stop sql injections also run and strings through

$string = mysql_real_escape_string($string);
__________________

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


lynxus is offline
Reply With Quote
View Public Profile Visit lynxus's homepage!
 
Old 03-10-2010, 05:39 AM Re: Sanitizing input
Experienced Talker

Posts: 41
Name: Adam B
Trades: 0
I strongly recommend reading PHP Freaks' security tutorial.
adam89 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Sanitizing input
 

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