<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB"><title>Comments on Writing Secure PHP, Part 2 - AddedBytes.com</title><link rel="alternate" type="text/html" href="http://www.addedbytes.com/article/writing-secure-php-2/" /><link rel="self" type="application/xml" href="http://www.addedbytes.com/article/writing-secure-php-2/comments/atom/" /><subtitle>Latest comments on Writing Secure PHP, Part 2 on AddedBytes.com</subtitle><author><name>Dave Child</name></author><updated>2005-03-22T16:53:00Z</updated><id>tag:addedbytes.com,2005:217</id><!-- ckey="76C662BB" --><entry><title>Comment on Writing Secure PHP, Part 2</title><link rel="alternate" type="text/html" href="http://www.addedbytes.com/article/writing-secure-php-2/comments/" /><summary type="text">Comment by Erick ( &lt;a href=""&gt;&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;You mention adding a delete indicator on a record.  I go beyond that on every table.  I add:&lt;br /&gt;
&lt;br /&gt;
update_datetime&lt;br /&gt;
update_user_id&lt;br /&gt;
create_datetime&lt;br /&gt;
create_user_id&lt;br /&gt;
delete_datetime&lt;br /&gt;
delete_user_id&lt;br /&gt;
&lt;br /&gt;
Then, anything that is done is logged.  At least the last execution of any of those.  If you need more granularity in something, then create a table that logs extended or historical information.</summary><id>tag:addedbytes.com,2008:105938</id><published>2008-10-27T18:15:27+00:00</published><updated>2008-10-27T18:15:27Z</updated></entry><entry><title>Comment on Writing Secure PHP, Part 2</title><link rel="alternate" type="text/html" href="http://www.addedbytes.com/article/writing-secure-php-2/comments/" /><summary type="text">Comment by Sandor ( &lt;a href=""&gt;&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;never trust user data, should we trust a webpage as well :-)&lt;br /&gt;
&lt;br /&gt;
I think banning an IP address is very dangerous, because if it's from a public provider with many users like AOL etc. than all other users from that provider will banned as well.&lt;br /&gt;
&lt;br /&gt;
-ciao Sandor-</summary><id>tag:addedbytes.com,2008:104479</id><published>2008-09-11T15:15:08+01:00</published><updated>2008-09-11T15:15:08Z</updated></entry><entry><title>Comment on Writing Secure PHP, Part 2</title><link rel="alternate" type="text/html" href="http://www.addedbytes.com/article/writing-secure-php-2/comments/" /><summary type="text">Comment by Web ( &lt;a href=""&gt;&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;Thank you so much for the posts! Very very helpful, I appreciate you for writing these security issues in PHP, I've learned quite a bit! CHEERS!</summary><id>tag:addedbytes.com,2008:83214</id><published>2008-03-19T10:10:51+00:00</published><updated>2008-03-19T10:10:51Z</updated></entry><entry><title>Comment on Writing Secure PHP, Part 2</title><link rel="alternate" type="text/html" href="http://www.addedbytes.com/article/writing-secure-php-2/comments/" /><summary type="text">Comment by Jamie ( &lt;a href=""&gt;&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;Great article! Thanks for sharing your knowledge!&lt;br /&gt;&lt;br /&gt;Is there any reason you can't use .htaccess to protect your .inc files (like below) without putting them in an /include folder?&lt;br /&gt;&lt;br /&gt;.htaccess file:&lt;br /&gt;&lt;Files ~ &quot;\.inc$&quot;&gt;&lt;br /&gt;   Order allow,deny&lt;br /&gt;   Deny from all&lt;br /&gt;&lt;/Files&gt;&lt;br /&gt;&lt;br /&gt;I was under the impression this was safe...</summary><id>tag:addedbytes.com,2008:80627</id><published>2008-03-03T19:22:47+00:00</published><updated>2008-03-03T19:22:47Z</updated></entry><entry><title>Comment on Writing Secure PHP, Part 2</title><link rel="alternate" type="text/html" href="http://www.addedbytes.com/article/writing-secure-php-2/comments/" /><summary type="text">Comment by Malanie ( &lt;a href="http://aber-natuerlich.de"&gt;http://aber-natuerlich.de&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;Good article. Event it is from 2005 the issues are still there. Advanced search technics like google's inurl makes it realy easy to find sites which use include folder, .inc files or whatever you are interestet in.</summary><id>tag:addedbytes.com,2008:78663</id><published>2008-02-24T10:31:06+00:00</published><updated>2008-02-24T10:31:06Z</updated></entry><entry><title>Comment on Writing Secure PHP, Part 2</title><link rel="alternate" type="text/html" href="http://www.addedbytes.com/article/writing-secure-php-2/comments/" /><summary type="text">Comment by Alan Walker ( &lt;a href="http://www.highforce.com"&gt;http://www.highforce.com&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;I have found the best way for looking at input, is to check the value for http or the length of the input as well as commands that should not be in there like ? = , as these script kiddies will do anything to hack your programs.&lt;br /&gt;All the best from Alan</summary><id>tag:addedbytes.com,2008:77814</id><published>2008-02-20T14:14:22+00:00</published><updated>2008-02-20T14:14:22Z</updated></entry><entry><title>Comment on Writing Secure PHP, Part 2</title><link rel="alternate" type="text/html" href="http://www.addedbytes.com/article/writing-secure-php-2/comments/" /><summary type="text">Comment by Anonymous ( &lt;a href=""&gt;&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;I do like this.. at the top of the include file.&lt;br /&gt;&lt;br /&gt;if ($ping != &quot;pong&quot;)&lt;br /&gt;{      &lt;br /&gt;    echo 'Redirect here, or print something :p';&lt;br /&gt;    exit;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;then in the script that's including it:&lt;br /&gt;&lt;br /&gt;$ping = &quot;pong&quot;;&lt;br /&gt;include(yourfile.....);&lt;br /&gt;&lt;br /&gt;Seems to work fine too.</summary><id>tag:addedbytes.com,2006:19358</id><published>2006-12-18T03:40:56+00:00</published><updated>2006-12-18T03:40:56Z</updated></entry><entry><title>Comment on Writing Secure PHP, Part 2</title><link rel="alternate" type="text/html" href="http://www.addedbytes.com/article/writing-secure-php-2/comments/" /><summary type="text">Comment by Frederik ( &lt;a href="http://www.misterbob.nl"&gt;http://www.misterbob.nl&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;Don't use safe mode, it will be dropped in PHP6</summary><id>tag:addedbytes.com,2006:17781</id><published>2006-12-08T01:04:37+00:00</published><updated>2006-12-08T01:04:37Z</updated></entry><entry><title>Comment on Writing Secure PHP, Part 2</title><link rel="alternate" type="text/html" href="http://www.addedbytes.com/article/writing-secure-php-2/comments/" /><summary type="text">Comment by alex boia ( &lt;a href=""&gt;&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;ok..so there are a lot of comments and so little time for me to read them. so i'm sorry if what that the topic this reply adresses has been already covered. but enough with the smalltalk.:)&lt;br /&gt;what i wnat to say is that if you want to protect your inlcuded php files to be executed from outside the script that uses them you can use something like:&lt;br /&gt;&lt;?php&lt;br /&gt;   define ('IS_INCLUDED_SOMEFILE', true);&lt;br /&gt;   require_once 'somefile.php';&lt;br /&gt;?&gt;&lt;br /&gt;in the script that requires the file and&lt;br /&gt;&lt;?php&lt;br /&gt;   if (!defined('IS_INCLUDED_SOMEFILE')) exit;&lt;br /&gt;   if (IS_INCLUDED_SOMEFILE !== true) exit;&lt;br /&gt;?&gt;&lt;br /&gt;in the required file.&lt;br /&gt;works very fine, as you define this constant only where you need to include the files&lt;br /&gt;?&gt;</summary><id>tag:addedbytes.com,2006:11040</id><published>2006-08-20T23:28:18+01:00</published><updated>2006-08-20T23:28:18Z</updated></entry><entry><title>Comment on Writing Secure PHP, Part 2</title><link rel="alternate" type="text/html" href="http://www.addedbytes.com/article/writing-secure-php-2/comments/" /><summary type="text">Comment by shopje ( &lt;a href="http://www.shopje.net"&gt;http://www.shopje.net&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;This one is a bit an expansion and elaboration to former part1 .&lt;br /&gt;I missed the usefull code examples you used in part 1.&lt;br /&gt;How about buffer overflows?&lt;br /&gt;Maybe you could be elaborating cross site scripting attacks?&lt;br /&gt;More methods of sql injection?&lt;br /&gt;Maybe a &quot;best way to secure&quot; part with the code examples to use for the newbies among us.&lt;br /&gt;And please get that link for a printable version.&lt;br /&gt;I of to read part 3</summary><id>tag:addedbytes.com,2006:5906</id><published>2006-03-20T11:32:11+00:00</published><updated>2006-03-20T11:32:11Z</updated></entry></feed>