php-general Digest 22 Sep 2011 11:55:38 -0000 Issue 7490

2011-09-22 Thread php-general-digest-help
php-general Digest 22 Sep 2011 11:55:38 - Issue 7490 Topics (messages 314969 through 314976): Escaping MySQL passwords necessary when md5 is used? 314969 by: Dotan Cohen 314970 by: Daniel Brown 314971 by: Igor Escobar 314972 by: Dotan Cohen 314973 by:

[PHP] How can I check for characters in a $_POST[] variable?

2011-09-22 Thread Eric
I have this problem when using php because my computer recognizes the characters . and .. as an existing file when I use file_exists. Also I want to check $_POST[username] for characters other then A-Z a-z and 0-9. If it contains anything other then, I would like to prompt the user but I can't

Re: [PHP] How can I check for characters in a $_POST[] variable?

2011-09-22 Thread Nilesh Govindarajan
On Thu 22 Sep 2011 08:25:29 PM IST, Eric wrote: I have this problem when using php because my computer recognizes the characters . and .. as an existing file when I use file_exists. Also I want to check $_POST[username] for characters other then A-Z a-z and 0-9. If it contains anything other

Re: [PHP] How can I check for characters in a $_POST[] variable?

2011-09-22 Thread Tommy Pham
On Thu, Sep 22, 2011 at 7:55 AM, Eric eric_justin_al...@cfl.rr.com wrote: I have this problem when using php because my computer recognizes the characters . and .. as an existing file when I use file_exists. Also I want to check $_POST[username] for characters other then A-Z a-z and 0-9. If

[PHP] RE: How can I check for characters in a $_POST[] variable?

2011-09-22 Thread Eric
if(preg_match('(.*)^[A-Za-z0-9]+', $_POST['username']) !== 0) { echo p style=\color:red;font-weight:bold;margin-left:95px\; echo Username must only contain A-Z and 0-9/p; include(register.html); exit; } I used the code above but I now get this error message Warning: preg_match()

Re: [PHP] How can I check for characters in a $_POST[] variable?

2011-09-22 Thread Igor Escobar
Use this regex: if(preg_match('/[[:punct:]]/', $_POST['username']) !== 0) { // string contains other characters, write the code } The POSIX class [:punct:] means matches any punctuation and symbols in your string and that includes [!#$%'()*+,\-./:;=?@[\\\]^_`{|}~] Regards, Igor Escobar

Re: [PHP] How can I check for characters in a $_POST[] variable?

2011-09-22 Thread Igor Escobar
Or... just use: if(preg_match('/^[A-Za-z0-9]+$/', $_POST['username']) !== 0) { // string contains other characters, write the code } You can see this regex in action here: http://regexpal.com/?flags=regex= ^%5BA-Za-z0-9%5D%2B%24input=myusername01 If you put anything different of A-Za-z0-9 the

Re: [PHP] RE: How can I check for characters in a $_POST[] variable?

2011-09-22 Thread Marco Lanzotti
Il 22/09/2011 17:54, Eric ha scritto: if(preg_match('(.*)^[A-Za-z0-9]+', $_POST['username']) !== 0) { Whi this '(.*)'? For '.' and '..' problem use is_file(). Bye, Marco -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: How can I check for characters in a $_POST[] variable?

2011-09-22 Thread Shawn McKenzie
On 09/22/2011 10:54 AM, Eric wrote: if(preg_match('(.*)^[A-Za-z0-9]+', $_POST['username']) !== 0) { echo p style=\color:red;font-weight:bold;margin-left:95px\; echo Username must only contain A-Z and 0-9/p; include(register.html); exit; } I used the code above but I now

[PHP] Re:

2011-09-22 Thread Eric
Thanks Very much I used, preg_match('/[[:punct:]]/', $_POST['username']) !== 0 and it works without errors. The reason I can't just use is_file which I wish I could is because windows doesn't allow question marks or some wierd character. It decides to not allow php to make the file if there are

Re: [PHP] RE: How can I check for characters in a $_POST[] variable?

2011-09-22 Thread Nilesh Govindarajan
On 09/22/2011 09:24 PM, Eric wrote: if(preg_match('(.*)^[A-Za-z0-9]+', $_POST['username']) !== 0) { echo p style=\color:red;font-weight:bold;margin-left:95px\; echo Username must only contain A-Z and 0-9/p; include(register.html); exit; } I used the code above but I now

Re: [PHP] Re:

2011-09-22 Thread Igor Escobar
No problem ;) Regards, Igor Escobar *Software Engineer * + http://blog.igorescobar.com + http://www.igorescobar.com + @igorescobar http://www.twitter.com/igorescobar On Thu, Sep 22, 2011 at 1:25 PM, Eric eric_justin_al...@cfl.rr.com wrote: Thanks Very much I used,

Re: [PHP] How can I check for characters in a $_POST[] variable?

2011-09-22 Thread Robert Williams
As an alternative to the regular expression approaches already provided by others, you could also use ctype_alnum(): if (ctyp_alnum($_POST['username'])) { //username contains only letters and numbers } else { //username contains characters other than letters and numbers } //if-else Docs:

[PHP] PHP process 32 v 64 bit virtual memory

2011-09-22 Thread James
Looking for some explanation (and verification) as to why the virtual memory increases by 5 fold (at the minimum) from 32 bit to 64 systems. I'm aware (for the most part) of the int, struct, etc changes from 32 to 64 bit. Results from running `php -r 'sleep(1000);' ` on 32 and 64 bit systems

Re: [PHP] How can I check for characters in a $_POST[] variable?

2011-09-22 Thread Nilesh Govindarajan
On 09/22/2011 10:36 PM, Robert Williams wrote: As an alternative to the regular expression approaches already provided by others, you could also use ctype_alnum(): if (ctyp_alnum($_POST['username'])) { //username contains only letters and numbers } else { //username contains

[PHP] What determines your use of the type of DB framework/abstract?

2011-09-22 Thread Jamie Krasnoo
Hey All, I'm guessing that the subject probably doesn't fit the question I'm asking here so I'll apologize in advance. Lately I've been getting in to how I can streamline my development after a bad experience with a contract. One of the areas I was looking at is when it would be appropriate to

[PHP] Any free online tests to test my PHP knowledge?

2011-09-22 Thread Mike Hansen
Does anyone know of a site that has an online test of PHP skills? I'd like to review my PHP knowledge. I've already run across this site: http://vladalexa.com/scripts/php/test/test_php_skill.html Thanks, Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Re:

2011-09-22 Thread Tommy Pham
On Thu, Sep 22, 2011 at 9:25 AM, Eric eric_justin_al...@cfl.rr.com wrote: Thanks Very much I used, preg_match('/[[:punct:]]/', $_POST['username']) !== 0 and it works without errors. The reason I can't just use is_file which I wish I could is because windows doesn't allow question marks or

Re: [PHP] What determines your use of the type of DB framework/abstract?

2011-09-22 Thread Jamie Krasnoo
Sorry, not sure if the first part of the conversation made it to the list. I will be looking in to Symfony. I'm well versed with ZF and Zend_Db. I'm also somewhat versed with Doctrine and integrating it with ZF. My question isn't whether Doctrine is a part *of* that framework but rather on *what*

Re: [PHP] Any free online tests to test my PHP knowledge?

2011-09-22 Thread George Langley
On 2011-09-22, at 11:53 AM, Mike Hansen wrote: Does anyone know of a site that has an online test of PHP skills? I'd like to review my PHP knowledge. I've already run across this site: http://vladalexa.com/scripts/php/test/test_php_skill.html Doesn't appear to be

Re: [PHP] How can I check for characters in a $_POST[] variable?

2011-09-22 Thread Robert Williams
[Redirecting thread back to the list for the benefit of others.] On 9/22/11 13:38, Eric eric_justin_al...@cfl.rr.com wrote: So is $_POST[username][0] appropriate or does that only work with normal variables? As far as this sort of manipulation goes, $_POST is just like any other variable.

Re: [PHP] Any free online tests to test my PHP knowledge?

2011-09-22 Thread Mike Hansen
On 9/22/2011 1:11 PM, George Langley wrote: On 2011-09-22, at 11:53 AM, Mike Hansen wrote: Does anyone know of a site that has an online test of PHP skills? I'd like to review my PHP knowledge. I've already run across this site: http://vladalexa.com/scripts/php/test/test_php_skill.html

Re: [PHP] What determines your use of the type of DB framework/abstract?

2011-09-22 Thread Lester Caine
Jamie Krasnoo wrote: My question isn't whether Doctrine is a part*of* that framework but rather on*what* and*when* it is appropriate to*use* or*substitute* something like Doctrine instead of using straight pdo or mysqli or the abstract that came with that particular framework. Substituting

Re: [PHP] What determines your use of the type of DB framework/abstract?

2011-09-22 Thread Paul M Foster
On Thu, Sep 22, 2011 at 11:31:54AM -0700, Jamie Krasnoo wrote: Sorry, not sure if the first part of the conversation made it to the list. I will be looking in to Symfony. I'm well versed with ZF and Zend_Db. I'm also somewhat versed with Doctrine and integrating it with ZF. My question

Re: [PHP] Any free online tests to test my PHP knowledge?

2011-09-22 Thread Paul M Foster
On Thu, Sep 22, 2011 at 11:53:54AM -0600, Mike Hansen wrote: Does anyone know of a site that has an online test of PHP skills? I'd like to review my PHP knowledge. I've already run across this site: http://vladalexa.com/scripts/php/test/test_php_skill.html Thanks, Mike I've had to

Re: [PHP] Any free online tests to test my PHP knowledge?

2011-09-22 Thread Paul Halliday
On Thu, Sep 22, 2011 at 6:44 PM, Paul M Foster pa...@quillandmouse.com wrote: On Thu, Sep 22, 2011 at 11:53:54AM -0600, Mike Hansen wrote: Does anyone know of a site that has an online test of PHP skills? I'd like to review my PHP knowledge. I've already run across this site:

Re: [PHP] Any free online tests to test my PHP knowledge?

2011-09-22 Thread Ross Hansen
There is the w3sxools website that has a php quiz. Http://www.w3schools.com/php/default.asp This site has many other languages that offer quizes also - Reply message - From: Mike Hansen skrab...@comcast.net To: php-general@lists.php.net Subject: [PHP] Any free online tests to test my