如何通过sql注入保护我的php页面

如何通过sql注入保护我的php页面,php,.htaccess,Php,.htaccess,这是我的页面,我想防止sql注入。怎么可能 我想显示上面的网址像这样 我也尝试使用.htaccess,但不起作用。 我的.htaccess代码如下: Options +FollowSymLinks RewriteEngine On RewriteRule ^read_story/([0-9a-zA-Z]+).html http://localhost/abc/read_story.php?story_id=$1 [QSA,L] 重写规则应该是 RewriteEngine on RewriteR

这是我的页面,我想防止sql注入。怎么可能

我想显示上面的网址像这样

我也尝试使用.htaccess,但不起作用。 我的.htaccess代码如下:

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^read_story/([0-9a-zA-Z]+).html http://localhost/abc/read_story.php?story_id=$1 [QSA,L]

重写规则应该是

RewriteEngine on
RewriteRule ^read_story/([0-9]+)$ read_story.php?story_id=$1 [NC,L]

使用准备好的语句抵御SQL注入攻击。

与SQL无关,SQL注入的可能重复与此无关。htaccess处理SQL查询并使用
准备好的语句