[PHP] simple question...
ey guys.. how do i check if the postdata is a valid time format? something like '2001-09-15' I hate it when they'll be entering garbage in it... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] simple question...
One more thing... If I got '2001-09-01' Is there a fast way of incrementing the month of it? making it '2001-10-01' ? - Original Message - From: * RzE: [EMAIL PROTECTED] To: Ker Ruben Ramos [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 6:04 AM Subject: Re: [PHP] simple question... Original message From: Ker Ruben Ramos [EMAIL PROTECTED] Date: Thu, Sep 20, 2001 at 08:56:03PM -0700 Message-ID: 00f801c14251$5aa288b0$bb05aacb@weblinqproxy Subject: [PHP] simple question... ey guys.. how do i check if the postdata is a valid time format? something like '2001-09-15' I hate it when they'll be entering garbage in it... /Original message Reply See the example below: --- PHP Example Code --- PRE ?php /* Valid date */ $myDate = 2001-09-12; /* Invalid date */ //$myDate = 2001-13-20; /* Another invalid date */ //$myDate = 20o1-10-x9; if (ereg (([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}), $myDate, $matches)) { if (checkdate ($matches[2], $matches[3], $matches[1])) { print (Valid date!\n\n); print (date (r, mktime (0,0,0,$matches[2], $matches[3], $matches[1]))); } else { print (No valid date!); } } else { print (No valid date!); } ? /PRE --- End of PHP Example Code --- /Reply -- * RzE: -- -- Renze Munnik -- DataLink BV -- -- E: [EMAIL PROTECTED] -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] simple question...
again.. one more thing How do I know how many days date differ? let's say '2001-09-01' and '2001-09-08'. Just looking for the fastest way of code to run. - Original Message - From: * RzE: [EMAIL PROTECTED] To: Ker Ruben Ramos [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 6:46 AM Subject: Re: [PHP] simple question... You should date() do the work here. So just take the month and then +1. Date() will take care the result is a valid date. Below is some example... Well... I meant: let mktime() do the work... not date(). Date() only shows the result of mktime() in a proper format. Mktime() makes sure it's a valid time(stamp) :) -- * RzE: -- -- Renze Munnik -- DataLink BV -- -- E: [EMAIL PROTECTED] -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] check if user exists
how do i check if user exist? I tried... $result = mysql_query(SELECT count(uname) FROM users WHERE uname=\'$username@$domain\'); if(isSet($result)) return(Username already exists.br\n); but still wont work.. :( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] command output
ey guys.. anyone know of doing something like with net.yahoo.com/cgi-bin/trace.sh?ip_here .. something that prints out every result of the traceroute command... not showing the result after command exited -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Safe_mode in certain directories
Ey guys! How do set only safe_mode = On in certain directories while others are Off. And vice versa. Thank You.
[PHP] safe_mode
If i had safe_mode = On; in php.ini, How do i set to have a certain directory that have safe_mode=Off ?
[PHP] Attachments in POP
Why are attachments in POP cannot be viewed in latest IMP? but if I use IMAP, it works just fine.
Re: [PHP] Attachments in POP
oops :) sorry... used the wrong lists - Original Message - From: Rasmus Lerdorf [EMAIL PROTECTED] To: Ker Ruben Ramos [EMAIL PROTECTED] Sent: Wednesday, June 20, 2001 10:59 PM Subject: Re: [PHP] Attachments in POP Why are attachments in POP cannot be viewed in latest IMP? but if I use IMAP, it works just fine. That would be a question for the IMP mailing list, not php-general. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ereg questions
Thanks alot, now i know what are thos \\$NUM but one more thing, where're those \\0 come from? just found it on some scripts using \\0. seems to confuse me a bit. Thanks - Original Message - From: Dan Lowe [EMAIL PROTECTED] To: Ker Ruben Ramos [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, May 24, 2001 5:18 PM Subject: Re: [PHP] ereg questions Previously, Ker Ruben Ramos said: hmm, got a little question. 1. what's that \\1 and \\2? got any info on where u got that from? Expands to whatever the parentheses surrounded during the match. So in this case you have: Match pattern: a href=\([^/]+)/(.*)\\.html\ Replace pattern: a href=\file.php?file=\\1\\2.php\ There are two places in the match pattern where there are (). These are memorized (rather whatever they actually matched was memorized) and then you can spit it back out in the replacement pattern using \\1, \\2, etc. -dan 2. what if it's just href=anything.html ? i mean.. something like it got lots of subdirectories or not. Thanks - Original Message - From: Mark Maggelet [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, May 24, 2001 1:19 AM Subject: Re: [PHP] ereg questions On Thu, 24 May 2001 01:01:16 +0800, Ker Ruben Ramos ([EMAIL PROTECTED]) wrote: How do i change all 'a href=anything/here.html' to 'a href=file.php?file=anythinghere.php' any help out there? I would go: $string = ereg_replace( a href=\([^/]+)/(.*)\\.html\, a href=\file.php?file=\\1\\2.php\, $string); - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- If carpenters made buildings the way programmers make programs, the first woodpecker to come along would destroy all of civilization. -Weinberg's Second Law -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] ereg questions
How do i change all 'a href=anything/here.html' to 'a href=file.php?file=anythinghere.php' any help out there?
Re: [PHP] ereg questions
hmm, got a little question. 1. what's that \\1 and \\2? got any info on where u got that from? 2. what if it's just href=anything.html ? i mean.. something like it got lots of subdirectories or not. Thanks - Original Message - From: Mark Maggelet [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, May 24, 2001 1:19 AM Subject: Re: [PHP] ereg questions On Thu, 24 May 2001 01:01:16 +0800, Ker Ruben Ramos ([EMAIL PROTECTED]) wrote: How do i change all 'a href=anything/here.html' to 'a href=file.php?file=anythinghere.php' any help out there? I would go: $string = ereg_replace( a href=\([^/]+)/(.*)\\.html\, a href=\file.php?file=\\1\\2.php\, $string); - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] security
ey guys, what are the functions that's disabled if safe_mode is On? also, what I just did now is disabling the functions exec() and system() just to prevent shell commands. but, how do i disable something like `ls -l /` ? the backticks. Thanks guys