| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#41 (permalink) |
|
unusual suspect ™
Join Date: Jul 2004
Location: DE, USA
Posts: 2,905
|
Not a function as such. Something I add to combat mail injection spammers. I've since added more but this is the version I have at hand: PHP Code:
|
|
|
|
|
|
#42 (permalink) |
|
Registered User
Join Date: May 2008
Posts: 2
|
First of all thanks . because this thread is very much helpful to learn php functions. some functions are:- zip_entry_read() Reads from an open entry in the ZIP file zip_open() Opens a ZIP file zip_read() Reads the next entry in a ZIP file |
|
|
|
#44 (permalink) |
|
I like code.
|
Simple class for sending email, with / without attachments. PHP Code:
Code { for thought }
"My programs never have bugs, they just develop random features." Last edited by Cborrow : 16-07-2008 at 08:14. |
|
|
|
#46 (permalink) |
|
Registered User
Join Date: Feb 2007
Posts: 31
|
PHP Code:
To just you just have the define a PATH and EXT variable. PATH: path way to your classes. EXT: extension for you classes (.php) PHP Code:
|
|
|
|
#47 (permalink) | |
|
Registered User
|
Quote:
Most of your comments were useless unlike the code he wrote. Honestly, commenting on coding convention and variable naming is just obnoxious. The comment I quoted, however, irked me the most, especially since it was never replied to. Multi-hashing is actually very useful especially if you know how hashes are reversed. If you hash a hash with a salt, chances are you will have a more secure result string than had you just used a salted hash. You are correct though it is not encryption. Also wasting resources? C'mon man. Don't post if you are just going to be making stuff up. An MD5 hash calculation on a 16 byte string is ridiculous to even consider a resource hog. |
|
|
|
|
#48 (permalink) |
|
shiro
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,713
|
Kind of late for that - that post was over half a year old. I don't think proc has even been around for a few months. But that being said, I've read quite a bit on salting and multi-hashing, and there are some arguments that show multi-hashing to actually reduce security. I didn't really understand it myself (beyond me), but the people who were making those arguments made them well. |
|
|
|
#49 (permalink) | |
|
Designers are strange :)
|
Quote:
Multi-hashing increases the chances of a collision. i.e. two words hashed over and voer could result in the same hash at the end. Because passwords usually aren't the same, they're random, especially if you have to have a number in there. But if you hash it with md5, you get a 32 character string, then hash that another 32 character string, so they're always 32 characters long. hashing over and over is bad practice, and it's better to use a dynamic and static salt. If it works, it's valid.
|
|
|
|
|
#50 (permalink) | |
|
Registered User
|
Quote:
Since this is a thread about PHP code and not the benefits of hashing, I'll drop it. However, if anything gets taken away from my previous post is that it is not completely pointless to multi-hash and it is not a resource hog as previously stated. Granted that post was a million years old, but this thread is the only stickied in this subforum. This thread is read, and I think it should at least be addressed. |
|
|
|
|
#51 (permalink) | |
|
Everything is fine.
|
Quote:
rotten.tomato@domain.com rebecca.bloggs@domain.com Reason being is that "eregi" is returning true on any occurrence of 'to' or 'cc' whether it's encapsulated in a legitimate word/address or not. Surely it would be better to do this instead: PHP Code:
By adding the colon to the expression match you are eliminating the chances of blocking potentially legitimate address through while still checking for any mail injection headers. |
|
|
|
|
#52 (permalink) | |
|
Senior Member
Join Date: Oct 2006
Posts: 2,203
|
Quote:
Hashing is quite CPU intensive compared to other tasks. Obviously if you have a website that isn't busy, and is on a dedicated server, then you should be fine. But if you are designing the login for Google accounts, then you need something as efficient as you can get. MD5 hashing isn't secure anymore, you should use SHA-512 instead, and salt the hash rather than hashing multiple times. |
|
|
|
|
#53 (permalink) | |
|
Registered User
Join Date: Aug 2008
Posts: 8
|
Quote:
That email validation function was originally from my site, and is a bit out of date now (especially since the opening up of the TLD system). I rewrote the code and released it a little while ago under an open source license - see addedbytes.com/blog/email-address-validation-v2/ Here's a couple of functions I find useful. They add and remove variables from querystrings (great if you're dynamically building querystrings, especially on listing pages with listing options). Add a Variable to a Querystring PHP Code:
Remove a Variable from a Querystring PHP Code:
|
|
|