|
Posted by Rik Wasmus on May 19, 2008, 8:08 am
Please log in for more thread options
> morph.1989@gmail.com wrote:
>> Hi, I can't get this script to work.
>> I've used this exact script on other places and it works, but now i
>> get this error.
>> <code> Warning: mysql_fetch_array(): supplied argument is not a vali=
d
>> MySQL result resource in C:\xampp\htdocs\uploads\login_script.php on
>> line 15 </code>
>> I can't see what is wrong.
>> Here is the script.
>> <code>
>> <?php
>> session_start();
>> $anvnamn =3D $_POST['usr'];
>> $losenord =3D $_POST['pwd'];
>> include "dbconnect.php";
>> $anv2 =3D mysql_real_escape_string($anvnamn, $dbconnect);
>> $los2 =3D mysql_real_escape_string($losenord, $dbconnect);
>
> You create some escaped versions of the $_POST data...
>
>> $sqlfraga =3D "SELECT anvnamn FROM administrator WHERE anvnamn =3D '"=
.
>> $anvnamn . "' AND losen =3D '" . $losenord . "'";
>
> ... but then fail to use them (SQL injection alert!).
Hehe, you beat me to it, with even more or less the same format/wording =
:D
-- =
Rik Wasmus
...spamrun finished
|