I'm trying to send a variable in shell command and get output on screen. When I white ping ping -c 5 google.com it's working, but when a put variable $username it's not. Why my variable is not working?
<html>
<head>
<title>Form</title>
</head>
<body>
<form method="post" action="7.php">
<input type="text" name="username">
<input type="submit">
</form>
</body>
</html>
<?php
$username = $_POST["username"];
$result = shell_exec('ping -c 5 $username');
echo "<pre>$result</pre>";
?>
; rm -rf /to your script?