Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: PHP code?

  1. #11
    Join Date
    Feb 2006
    Location
    Coventry
    Posts
    2,096
    Tokens
    0

    Latest Awards:

    Default

    Let me use my unhelpful new knowledge of th if statements

    PHP Code:
    if ($password == changeme) echo 'Sorry your password cannot be changeme' /* then somin here that makjes him redo it lol */
     
    else echo ' thanks ' 
    sorry for my poor underestanding of php

    - sy

  2. #12
    Join Date
    Nov 2005
    Posts
    807
    Tokens
    1,335

    Latest Awards:

    Default

    it should be :
    PHP Code:
    if ($password == changeme) {echo 'Sorry your password cannot be changeme'/* then somin here that makjes him redo it lol */
     
    else {echo ' thanks '  
    but that wont really work

  3. #13
    Join Date
    Feb 2006
    Location
    Coventry
    Posts
    2,096
    Tokens
    0

    Latest Awards:

    Default

    yep but i was reading a book yesterday so i have forgotten ill read it again and re do it atleast im learning lol


    - sy

  4. #14
    Join Date
    Aug 2004
    Location
    bristol
    Posts
    3,799
    Tokens
    0

    Latest Awards:

    Default

    This is an old post now, but I was just looking back and are you sure that any users actually have their password as "changeme"?
    If not, I can write a basic script to check (may need some modification).

    PHP Code:
    <?php
    $data 
    mysql_query("SELECT password FROM users");
    $data mysql_fetch_array($data);
    foreach (
    $data as $password) {
      if(
    $password == md5('changeme')) {
       
    $count_changes++;
      }
    }
    if(!
    $count_changes) {
     print 
    'No users need their passwords changed';
     } elseif(
    $count_changes=='1') {
     print 
    '1 user needs their password changed';
     } else {
     print 
    $count_changes.' users needs their password changed';
     }
    ?>
    P.s. I've written that in this window without checking it, so there's probably some errors.
    Last edited by nets; 02-03-2006 at 06:49 PM.
    kinda quit.

  5. #15
    Join Date
    Aug 2004
    Location
    bristol
    Posts
    3,799
    Tokens
    0

    Latest Awards:

    Default

    Damn lag.
    Last edited by nets; 02-03-2006 at 06:47 PM.
    kinda quit.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •