You are here: Re: Listing table data with an option to delete each individual item. « PHP Programming Language « IT news, forums, messages
Re: Listing table data with an option to delete each individual item.

Posted by Jerry Stuckle on 02/06/06 03:49

Geoff Berrow wrote:
> Message-ID: <F-qdnc_NlcIkrHveRVn-iA@comcast.com> from Jerry Stuckle
> contained the following:
>
>
>>You need to be VERY careful on this one. You aren't validating the data.
>>
>>For instance - what happens if I type in the browser:
>>
>> http://www.example.com/delete.php?id=5+OR+1%3d1
>>
>>Your query ends up as "delete from people where id=5 or 1=1";
>>
>>Google for 'sql injection".
>
>
> Also, I would avoid having links that delete files altogether. If a
> search engine ever makes it to that page all your data will be deleted.
>
> I usually make the table a form and use checkboxes
> echo "<input type ='checkbox' name='del[]'value=$id>";
>
> Name all the boxes 'del[]' When posted the items to be deleted will be
> in an array and you can loop through it and delete them.
>

Geoff,

And what happens if I come along and post a form back to your page with:

<input type ='checkbox' name='del[]' value="1 OR 42=42">

ALWAYS validate incoming data - even if it's from a checkbox!
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация