Possible Duplicate:
PHP warning help?
Ben () 3. hatta aşağıdaki uyarıyı almaya devam ben mysqli_real_escape_string yanlış düşünüyorum PHP ve MySQL için yeni.
Uyarı: mysqli_real_escape_string () verilen tam olarak 2 parametre, 1 bekliyor
İşte php kodudur.
<?php
$page = mysqli_real_escape_string($_SERVER['SCRIPT_FILENAME']);
// Query member data from the database and ready it for display
$mysqli = new mysqli("localhost", "root", "", "sitename");
$dbc = mysqli_query($mysqli,"SELECT id page FROM mysql_counter_logs WHERE page = '$page'");
if (mysqli_num_rows($dbc) == 0) {
$mysqli = new mysqli("localhost", "root", "", "sitename");
$dbc = mysqli_query($mysqli,"INSERT INTO mysql_counter_logs (page) VALUES ('$page')");
}
if ($dbc == 1) {
$dbc = mysqli_query($mysqli,"UPDATE mysql_counter_logs SET hits = hits + 1 WHERE page = '$page'");
}
//Retreives the current count
$count = mysqli_fetch_row(mysqli_query($mysqli,"SELECT hits FROM mysql_counter_logs"));
if (!$dbc) {
// There was an error...do something about it here...
print mysqli_error();
}
//Displays the count on your site
print "$count[0]";
?>
Ayrıca ben XSS saldırıları, bu kodu daha güvenlik kanıtı yapabilirsiniz bir yolu yoktur. Teşekkürler