Benim sayfalara erişmek için sorgu dizesi kullanın. Kimsenin türü bilinmiyor sorgu dizesi elle, daha sonra bir yere yönlendirmek eğer yapmayı deneyin ..
Örneğin:
Url: test.php?m=1 (this is a valid url) test.php?m=1324234 (this is not a valid url ) test.php?m=1asdaa (this is not a valid url )
include("config/database.inc");
$qm=$_GET['m'];
$query = "select acc from test where acc=$qm";
$numresults=mysql_query($query);
$numrows=mysql_num_rows($numresults);
if ($numrows == 0){
header("Location: index.php");
exit;
}
Veritabanında i iki çizgi, çizgi var 1: acc = 1; HAT 2: acc = 2;
If i type to the url: test.php?m=12312431, then redirect to index.php 'coz $numrows=0. Thats ok. But if i type: test.php?m=1sdfsfsf, then i got this error msg.: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in..
Ben bunu nasıl yapabilirim? Veritabanından sorgu önce $ _GET ['m'] kontrol etmeniz gerekir?
Teşekkür ederim.