Hello,all
It is around 5 months that i'm working on a site for music streaming(not online yet) with mysql-php
and have heard about these attacks that we must consider,i appreciate that guide the best way for protection.
-Sql injection attack:
for connecting to db i use these codes ,are these safe?if no,please your guide.
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = 'pari';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
$dbname = 'musicarchive';
mysql_select_db("$dbname");
mysql_query('SET NAMES utf8',$conn); //for utf charachter
-Header injection attack:
At the top of a page i use these codes for redirecting ,are these also safe?
<?php
if ( strlen ($_REQUEST['Textfield1']) < 3 )
{
header ("Location:
http://localhost/PersianPersiaPHP/music/alert.php");
}
?>
-I have heard something about "echo attack" also ,but i don't know what is it,and what are issues that i must consider?
Thanks