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:
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
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
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
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()
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
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
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
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
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
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
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,
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:
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
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
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
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:
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
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*
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
[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.
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
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
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
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
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:
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
27 matches
Mail list logo