I have created a website however i have left preventing injection last because its what i have found most challenging.
Im now at the point where i need to convert all my quires which contain a variable or '$_GET' to a parameterised queries.
Here is an example of a couple of my queries :
SELECT
$storename = urldecode($_GET['name']);
$ress = $conn->query("SELECT * FROM pages WHERE storename = '$storename'");
$page=$ress->fetch_array();
DELETE
if(isset($_GET['del']))
{
$id = $_GET['del'];
$category = str_replace(".png","", $_GET['category']);
$SQL = $conn->query("DELETE FROM categories WHERE id='$id'");
$SQL = $conn->query("DELETE FROM categories WHERE category='$category'");
}
I have watched loads of tutorials read loads of post explaining this, however i am completely stuck with it, if anyone does not mind showing me how to prevent injection with these 2 queries that would be greatly appreciated. I could then look at how you have done it and apply this to other queries across my site.
Thankyou for any help