From:             pretty dot killer at hotmail dot com
Operating system: windows xp
PHP version:      5.2.4RC1
PHP Bug Type:     *General Issues
Bug description:  sad

Description:
------------
dont run 

Reproduce code:
---------------
<?php
if(ereg("^([a-zA-Z0-9_-])*$", $_POST['account']) &&
ereg("^([a-zA-Z0-9_-])*$", $_POST['password']) &&
ereg("^([a-zA-Z0-9_-])*$", $_POST['password2']))
{
        if ($page="index.php" && $_POST['account'] &&
strlen($_POST['account'])<16 && strlen($_POST['account'])>3 &&
$_POST['password'] && $_POST['password2'] &&
$_POST['password']==$_POST['password2'])
        {       
                $check=mysql_query("select * from accounts where
login='".$_POST['account']."'");
                $check1=mysql_num_rows($check);
                if($check1>0)
                {
                        echo "<p clss='error'><b>Failed to register : an 
account already excist
.</b></p>";
                }
                else
                {
                        mysql_query("INSERT INTO accounts (login, password, 
access_level)
VALUES ('".$_POST['account']."', '".base64_encode(pack('H*',
sha1($_POST['password'])))."', 0)", $link);
                        mysql_close($link);
                        print '<p class="error"><b>Registration over successful 
</b></p>';
                }
        }
        else
        {
        print '<p class="error"><b> </b></p>'.mysql_error();
        }
}
else
{
        echo "Restrictions have not been tested for safety. Please try to sign 
up
with another username and password.";
}
?>

Expected result:
----------------
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
resource in \insert.php on line 7

Registration over successful


Actual result:
--------------
a

-- 
Edit bug report at http://bugs.php.net/?id=42296&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42296&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42296&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42296&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=42296&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=42296&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=42296&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=42296&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=42296&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=42296&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=42296&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=42296&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=42296&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=42296&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42296&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=42296&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=42296&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=42296&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42296&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=42296&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=42296&r=mysqlcfg

Reply via email to