I today found some files created and deleted and edited on my website. I don't know how it is done. But I know it can be done by some PHP Functions like :
mkdir('Folder'); file_put_contents();scandir();...
But these codes only execute if I write in my PHP code.
How anyone can run these commands from a $_GET Value
Example PHP Code that is showing the ?name query from the URL.
<?php
echo "$_GET[name] Welcome";
?>
Can code be injected in this and hack my website?
Like https://example.com?name=".mkdir("Hacked")."
If yes, then how can I prevent these kinds of bugs and hacks?