Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Rex Expression for PHP
Old 12-07-2003, 03:07 AM Rex Expression for PHP
ACJavascript's Avatar
Humble Mod

Posts: 548
Location: CT, USA
Trades: 0
Hey okay,, Now How can I have a Reg Expression for a username field...

This is what I have below:

if($Uname != "[-a-zA-Z0-9._"){

So that says if The username does not equal either a letter from A-Z o a number from 0-9 then Report and error...

Is this correct,, because its not working lol..

Any help is most appreciated.
__________________

Please login or register to view this content. Registration is FREE
- 100 Satisfied Customers - Custom Programming and Web Development
ACJavascript is offline
Reply With Quote
View Public Profile Visit ACJavascript's homepage!
 
 
Register now for full access!
Old 12-08-2003, 01:42 PM
ACJavascript's Avatar
Humble Mod

Posts: 548
Location: CT, USA
Trades: 0
NEVER MIND hehehe

You can delete this post
__________________

Please login or register to view this content. Registration is FREE
- 100 Satisfied Customers - Custom Programming and Web Development
ACJavascript is offline
Reply With Quote
View Public Profile Visit ACJavascript's homepage!
 
Old 12-08-2003, 01:51 PM
DaveMo~'s Avatar
Administrator
Defies A Status

Posts: 10,200
Name: Dave
Location: Scott Depot, West Virginia, USA
Trades: 1
Any valuable lessons that we can learn here? If not, I can delete it if you want.

Dave
__________________

Please login or register to view this content. Registration is FREE
:
Please login or register to view this content. Registration is FREE
:
Please login or register to view this content. Registration is FREE
:

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
?

DaveMo~ is offline
Reply With Quote
View Public Profile
 
Old 12-08-2003, 02:01 PM
ACJavascript's Avatar
Humble Mod

Posts: 548
Location: CT, USA
Trades: 0
Yea dave,

Okay I was oringanly trying to use this Regular Expression.

if($Uname != "[-a-zA-Z0-9._")

This ofcourse did not work correctly. I then was informed by a friend that you needed to use preg_match... So this is now the Expression...

if(preg_match("/([a-zA-Z0-9])/",$Uname))


__________________

Please login or register to view this content. Registration is FREE
- 100 Satisfied Customers - Custom Programming and Web Development
ACJavascript is offline
Reply With Quote
View Public Profile Visit ACJavascript's homepage!
 
Old 12-08-2003, 02:36 PM
DaveMo~'s Avatar
Administrator
Defies A Status

Posts: 10,200
Name: Dave
Location: Scott Depot, West Virginia, USA
Trades: 1
Thanks for the lesson. This could prove helpful sometime.

Dave
__________________

Please login or register to view this content. Registration is FREE
:
Please login or register to view this content. Registration is FREE
:
Please login or register to view this content. Registration is FREE
:

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
?

DaveMo~ is offline
Reply With Quote
View Public Profile
 
Old 12-08-2003, 08:06 PM
ACJavascript's Avatar
Humble Mod

Posts: 548
Location: CT, USA
Trades: 0
Here are some other interesting ways:

$Upassword is the password field in the form.


if(ereg('[^A-Za-z0-9]',$Upassword)){
echo("NO WEIRD CHARACTERS!");
exit;
}


__________________

Please login or register to view this content. Registration is FREE
- 100 Satisfied Customers - Custom Programming and Web Development

Last edited by ACJavascript; 12-08-2003 at 08:11 PM..
ACJavascript is offline
Reply With Quote
View Public Profile Visit ACJavascript's homepage!
 
Reply     « Reply to Rex Expression for PHP
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.49508 seconds with 12 queries