Re: [PHP] Convert deprecated POSIX functions into wrappers for equivalent PCRE functions

2009-11-09 Thread Paul Fierro
On 11/9/09 8:56 AM, Tony Marston t...@marston-home.demon.co.uk wrote:

 I have tried subscribing to the internals list, but none of my postings ever
 appears.

That's unfortunate as you missed this thread:

http://marc.info/?t=12553625831r=1w=2

Paul



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Name Capitalization

2007-03-19 Thread Paul Fierro
On 3/19/07 12:24 PM, Leonard Burton [EMAIL PROTECTED] wrote:

 Yeah, nothing is a perfect solution but anything is better than nothing.
 
 Guys, Thanks for the replies and the link to the recent thread, even
 though that didn't discuss any solutions to the problem I am asking
 about (other than to point it out which helps because it points out a
 few of the name problems)!
 
 Would anyone care to work on this project together?

Hi Leonard,

Take a look at this Perl module - it may be of use to you:

http://search.cpan.org/~summer/Lingua-EN-NameCase-1.13/NameCase.pm

Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Phone Number Validation

2005-05-17 Thread Paul Fierro
On 05/16/2005 7:48 PM, IMEX Research [EMAIL PROTECTED] wrote:

 OK, I know this has probably gone aruond the list a few times, but how do I
 validate a phone number that is in the format ddd-ddd- ??  I can't figure
 out how.

I try to not restrict the way your users enter phone numbers or other types
of structured data. I wouldn't bother validating against ddd-ddd- unless
you also plan on validating (ddd) ddd-, ddd.ddd., +1 ddd ddd ddd or
any number of variations. Your best bet is to make sure that the number
contains 10 (or 11) digits:

$phone = preg_replace('/[^0-9]/', '', $phone); # remove non-numbers

if (preg_match('/^1?[0-9]{10}$/', $phone)) {
echo 'Valid';
}

To answer your original question:

if (preg_match('/^[0-9]{3}-[0-9]{3}-[0-9]{4}$/', $phone)) {
echo 'Valid';
}

Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Is flock() necessary on a simple file append?

2004-10-25 Thread Paul Fierro
On 10/24/2004 5:11 PM, Kevin Grigorenko [EMAIL PROTECTED] wrote:
 
 I am appending to a file one line of text on every page hit, so there could
 be many occurrences of this append simultaneously.  I am not opening for
 write (w) but for append (a). Do I need to use flock() to be sure there
 are no issues?  I am running on Solaris.

On 10/24/2004 5:39 PM, Hristo Yankov [EMAIL PROTECTED] wrote:

 append is the same as write (it requires write access
 for example), so if you are gonna use flock for w,
 use it for a too.

According to this post, you do not need to use flock() if you open a file in
append mode:

http://marc.theaimsgroup.com/?l=php-generalm=105165806915109w=2

Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] --disable-url-fopen-wrapper gone?

2004-10-06 Thread Paul Fierro
On 10/05/2004 12:03 PM, Marten Lehmann [EMAIL PROTECTED] wrote:

 Hello,
 
 one account of a user on our webserver was compromised using a feature
 of fopen to load external sources. As of the documentation, there shall
 be a configure option called --disable-url-fopen-wrapper.
 Unfortunately, this option doesn't seem to exist in 4.3.9. How can I set
 a default for allow_url_fopen during the compilation? Or is the only way
 to set
 
 allow_url_fopen=0
 
 in the master php.ini?

As of PHP 4.3.5, I believe the only way to change allow_url_fopen is via
php.ini or httpd.conf. AFAICT, --disable-url-fopen-wrapper disappeared in
PHP 4.0.4.

Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP logic - Whats going on here?

2004-08-11 Thread Paul Fierro
On 08/11/2004 9:28 AM, Kim Steinhaug [EMAIL PROTECTED] wrote:

 Thanks for your reply, it all seems logical when you think of it,
 still I also think it sounds logical without the extra ELSE statement
 since the function has to executed for the first IF to do the comparison,
 meaning that the email should be sendt in the first place. (If it didnt
 how could it state FALSE or TRUE, unless PHP only simulates the
 function if it falls outside the initial IF statement)
 
 However, no reason to argue the obvious, :D
 
 On the other hand, this would also mean that the exmaples from
 phpmailers homepage are wrong :
 
 [ SNIP FROM http://phpmailer.sourceforge.net/extending.html ]
 $mail-Body= $body;
 $mail-AltBody = $text_body;
 $mail-AddAddress($row[email], $row[full_name]);
 $mail-AddStringAttachment($row[photo], YourPhoto.jpg);
 
 if(!$mail-Send())
 echo There has been a mail error sending to  . $row[email] .
 br;
 [ /SNIP]
 
 This is probably why I in the first place removed the extra ELSE statement,
 since I didnt see any reason for it. But in future Ill always include it it
 seems, :D

I've been using PHPMailer like this for years:

if (!$mail-Send()) { }

You shouldn't need an extra else { }, Jay's reasoning nonetheless. That
being said, I don't know why it isn't working for you.

Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Cookie Security?

2004-06-14 Thread Paul Fierro
On 06/14/2004 1:02 PM, Justin Patrin [EMAIL PROTECTED] wrote:

 As well as much harder for AOL subscribers (whose IP's change per-request)
 to use the site.
 
 WHAT?? Are you sure of this? AOL really breaks internet browsing this
 much? Sorry, I can't believe this. If this was true, many things would
 break. I know that dial-up users get different IPs every time they
 connect, but for somehting like this to happen, they'd have to be using
 some kind of round-robin DNS for a proxy server or some kind of wacky
 load balancing. Can you point us to a resource that verifies this?

[W]ebmasters should not make assumptions about the relationship between
members and proxy servers when designing their web site.

http://webmaster.info.aol.com/proxyinfo.html

Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php