Computing.Net > Forums > Web Development > What's this PHP code mean?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

What's this PHP code mean?

Reply to Message Icon

Name: robber2
Date: October 26, 2007 at 08:06:46 Pacific
OS: w xp home
CPU/Ram: 2 gig celeron, 256 MB
Product: dell dim 2350
Comment:

What exactly is this snippet of PHP checking for :

function checkOK($field)
{
if (eregi("\r",$field) || eregi("\n",$field)){
die("Invalid Input!");
}
}



Sponsored Link
Ads by Google

Response Number 1
Name: Michael J (by mjdamato)
Date: October 26, 2007 at 23:45:27 Pacific
Reply:

It is a function that takes a string variable. If that string variable contains a newline (\n) or a carriage return (\r) then the function will halt any further execution of the script and display the error message "Invalid Input!"

Michael J


0

Response Number 2
Name: Laler
Date: October 27, 2007 at 02:06:31 Pacific
Reply:

And the purpose is to spot spambots that tries to use this "bug":

http://www.jellyandcustard.com/2006...

Basically, unsecured mail forms can be used by anyone to send emails to anyone 0_0

---
Free host that surpasses standard-shared-hostings. Reliability unknown ^o^


0

Response Number 3
Name: robber2
Date: October 27, 2007 at 09:45:37 Pacific
Reply:

Thanks, dudes. That explains that!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: What's this PHP code mean?

help with php code! www.computing.net/answers/webdevel/help-with-php-code/3049.html

What's wrong with Google?!! :@ www.computing.net/answers/webdevel/whats-wrong-with-google-/1083.html

What is wrong with this PHP script? www.computing.net/answers/webdevel/what-is-wrong-with-this-php-script/1327.html