PHP - Moved: Generating A Password Without The Letters 'oh' Or 'el' Or The Numbers 1 Or 0
This topic has been moved to PHP Regex.
http://www.phpfreaks.com/forums/index.php?topic=333172.0 Similar TutorialsMaybe it's a Regex question, but I'm wondering how one would go about generating alphanumeric passwords that do not contain either the letters 'oh' or 'el', or the numbers 1 (one) or 0 (zero)? In other words, the p/w can contain any letters of the alphabet - apart from 'oh' and 'el' - and any digits from 2 to 9 inclusive. The p/w length is not critical - let's say 8 characters. Thanks in advance for your help. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=318062.0 Hi Guys
I have a regex conundrum that at first I thought would be very easy but then appears to be quite hard :/
I want to match a string with a regex where the regex can only pass if it contains letters and numbers (nothing else) and it has to contain at least one of each.
I've been trying out lookaheads but just can't get it right.
Any help is appreciated.
Drongo
Hey. I been using a function to check if a string contains only letters which is: ctype_alpha But i would like to change it to allow numbers 0 to 9 and the letters is there a function to do that in PHP i can't find it. I'm certain this has been done a hundred times before, but I have been unable to find any information on an efficient way of doing this: I'm creating a membership system, and the password for new users needs to contains both numbers and letters. How do I go about checking this? The key is not that it contains only numbers and letters, but that it contains both. The password cannot be all letters or all numbers. Know what I mean? Cheers guys and gals. Can I somehow mix letters with numbers to create an array with range()? e.g. I want my array for postcode ranges such as array('AB1','AB2', 'AB3', 'AB4', 'AB5', 'Ab6', 'AB7', 'AB8', 'IV5', 'IV6', 'IV7', 'IV8', 'IV9', 'IV10'); I know I can do range(1,8); but was wondering if there was something along the lines of range("AB1", "AB8"); I need users to input ONLY numbers or letters with numbers. How can i go about fixing that. Thank you. Here is my code if(isset($_POST['pass_btn'])) { $numchars = 8; $chars = explode(',','2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,m,n,p,q,r,s,t,u,v,w,x,y,z,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,T,U,V,W,X,Y,Z,2,3,4,5,6,7,8,9'); $password=''; for($i=0; $i<$numchars;$i++) { $password.=$chars[rand(0,count($chars)-1)]; } } This is set up so when a person pressing the pass_btn, a password is provided. This works just fine. However, it refreshes the page and clears all other data that user may have entered. Suggestions? This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=353345.0 Hi all, Here i have a serious problem. I want to sought it out using PHP and MySQL only. I have a form includes fields of customer id and Account type( stored in a jump menu and includes 6 different types of accounts) <style type="text/css"> <!-- body,td,th { font-size: 18px; font-weight: bold; } --> </style> <p><img src="../images/mahapitiya 1.jpg" width="1024" height="139" /></p> <form id="form1" name="form1" method="post" action=""> <label> <input type="submit" name="button" id="button" value="Logout" /> </label> </form> <p> </p> <form action="" method="post" name="form2" id="form2" onsubmit="return Validate();"> <fieldset> <legend class="cap">Create an Account</legend> <table width="75%" border="0" cellspacing="0" cellpadding="5" align="center"> <tr> <td> </td> <td class="title02"> </td> <td> </td> <td> </td> </tr> <tr height="30"> <td width="10%"> </td> <td width="25%" class="title02" align="left">Customer ID</td> <td width="55%" class="attribute1" align="left"><input type="text" name="customer_id" class="attribute1" /></td> <td width="10%"> </td> </tr> <tr height="30"> <td> </td> <td width="25%" class="title02" align="left">Account Type</td> <td width="55%" align="left" bgcolor="#FFFFFF" class="attribute1"><select name="account_type" id="jumpMenu" > <option selected="selected"></option> <option>Savings Investment</option> <option>Shakthi</option> <option>Surathal</option> <option>Abhimani Plus</option> <option>Yasasa Certificates</option> <option>Fixed Deposits</option> </select> </td> <td width="10%"> </td> </tr> </table> <p align="center"> </p> <p align="center"> <input type="submit" onclick="return Validate();" name="submit" value="Submit" class="attribute1" /> <input type="reset" name="reset" value="Reset" class="attribute1" /> <label> <input type="submit" name="button2" id="button2" value="Help" /> </label> </p> </fieldset> </td> <td width="5%"> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td align="center"> </td> <td> </td> </tr> <tr> <td> </td> <td><font color="red" size="1" ></font></td> <td> </td> </tr> </table> </form> <p> </p> <script language = "Javascript"> function Validate() { if (document.form2.customer_id.value == '') { alert('Please enter the valid customer id!'); return false; } else if ( document.form2.account_type.selectedIndex == '' ) { alert ( "Please select an account type!." ); return false; } return true; } </script> There are 6 different types of tables exist in my database representing 6 different types of accounts.Each and every table there is a field called "account number" which is auto incremented.When user clicks on submit button i want account number to be opened based on selected account type. How this could be done? Thanks, Heshan. This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=331361.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=354853.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=345334.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=357017.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=322151.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=353188.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=348558.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=307298.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=314698.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=309461.0 |