[Tutorial] PHP with MySQL
#8

PHP код:
$_GET['User'] = mysql_real_escape_string($_GET['User']); //Prevent any SQL Injections. 
This is wrong, hackers can easily implement XSS/CSRF attack into the input.

PHP код:
function Escape($string)
{
      
$string htmlentities($string);
      
$string stripslashes($string);
      
$string mysql_real_escape_string($string);
      return 
$string;

PHP код:
while($data mysql_fetch_array($result)) // Make $data an array of the query you just executed.
{
    echo 
"<tr>
    <td>"
.$data['Username']"</td>
    <td>"
.$data['Money']."</td>
    </tr>"
;

PHP код:
mysql_free_result($result);//Forgot to free the result ? 
PS: This tutorial is full of security holes.
Reply


Messages In This Thread
PHP with MySQL - by coole210 - 29.06.2011, 16:19
Re: PHP with MySQL - by nielsbon1 - 29.06.2011, 21:11
Re: PHP with MySQL - by jameskmonger - 29.06.2011, 21:20
Re: PHP with MySQL - by coole210 - 29.06.2011, 21:22
Re: PHP with MySQL - by [Ask]Terminator - 29.06.2011, 21:24
Re: PHP with MySQL - by nielsbon1 - 29.06.2011, 21:25
Re: PHP with MySQL - by coole210 - 30.06.2011, 02:07
Re: PHP with MySQL - by XFlawless - 30.06.2011, 03:37
Re : PHP with MySQL - by Harry_Sandhu - 30.06.2011, 07:25
Re: PHP with MySQL - by HP - 25.07.2011, 14:06

Forum Jump:


Users browsing this thread: 1 Guest(s)