Jump to content

Paradoxz

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Everything posted by Paradoxz

  1. Excellent script as well, I am trying to get better at Regex (hence the more complicated approach I took) Thanks for your help!
  2. The end of line modifier is working great and limiting it at 12. See code below, you can also try it here: http://failbet.com/acct/add.php // password validator $passpattern = "/^(\d|[a-z]){8,12}$/"; if(!preg_match($passpattern, $_POST['pass'])) { header("location:add.php?errorcode=5"); die(''); } Thanks again everyone!
  3. Fugix, great advice on the /i Not sure why, but on my email validator and password validator I don't use /i and I only specify a-z not a-zA-Z and it works fine for upper or lower case, so I always omit the /i and A-Z
  4. Ah yes, the ^ begins with and $ ends with. It works now that they are added, how dumb of me to forget them. /^(\d|[a-z]){8,12}$/ is what I used. it's the same as you wrote, except \d is identical to 0-9 I guess having to throw | in there makes it the same amount of characters though, and probably the same speed. thank you.
  5. Yes, Regex.. everyone's most feared topic. I hope some brave soul can help. Trying for password validation, numbers and letters only allowed and 8-12 characters. I have tried hundreds of combinations, the one below is the closest I have gotten. The issue is anything under 8 doesn't work but everything over 12 still does for some reason. /(\d|[a-z]){8,12}/ also tried: (same results) /\d|[a-z]{8,12}/ Anyone know why the 12 isn't registering? // password validator $passpattern = "/(\d|[a-z]){8,12}/"; if(!preg_match($passpattern, $_POST['pass'])) { header("location:add.php?errorcode=5"); die(''); }
  6. I am working on a site that is going to have hundreds of polls that people can vote on. Once any user creates a new poll (vote: Hayden Panettiere vs. Kristen Bell as an example) I want to have the database remember what member voted on what, for each poll. So user 1 voted Hayden, user 327 voted Kristen.. etc.. I expect up to 500 users to vote on each topic, but a new column to store each username that voted seems insane. I was thinking arrays, but am not sure if that would work. I don't think that a new table per poll would be very efficient either, it would be like 500++ tables on one database. To explain better, my username is Paradox and I vote for Kristen Bell. When I look at this database I want to see: ID Title Option1 Option2 People who voted option 1(27 people) People who voted option 2(783 people) 1 Heroes 27 783 {Blah, Blah, Blah} {Paradox, Blah, Blah} Is an array a good way to go about this? Because I also want to be able to expand the array to notify each member they voted with the winning or losing team once the poll expires.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.