Enviado em 31/01/2017 - 17:17h
Pessoal estou tentando fazer um script com um fomulário em html transferindo para um php onde dele executa o script shell, estou utilizando a função GET para pegar os dados do html e transferir para o php. O php já está recendo os dados porem não está executando o shell_exec ele apenas exibe os dados, posso realmente fazer isso com a função GET do php ou ela é apenas para exibição ? abaixo estão os aquivos.
HTML
<html>
<head>
<title>Entrada de Dados para o MRTG</title>
</head>
<body>
<h1>Preencha os dados abaixo</h1>
<form name='formulario' method='get' action='mrtg_get.php'>
<label>Nome do Equipamento:</label>
<input type='text' name='nomedoequip' value=''>
<label>IP do equipamento:</label>
<input type='text' name='ipdoequip' value=''>
<input type='submit' name='btnEnviarDados' value='Enviar'>
</form>
</body>
</html>
PHP GET
<?php
$txtnomedoequip = $_GET["nomedoequip"];
$txtipdoequip = $_GET["ipdoequip"];
echo "O nome do equipamento criado é ".$txtnomedoequip." e o ip é ".$txtipdoequip.;
shell_exec('mkdir /var/www/html/mrtg/.$txtnomedoequip.');
?>
HTML
<html>
<head>
<title>Entrada de Dados para o MRTG</title>
</head>
<body>
<h1>Preencha os dados abaixo</h1>
<form name='formulario' method='get' action='mrtg_get.php'>
<label>Nome do Equipamento:</label>
<input type='text' name='nomedoequip' value=''>
<label>IP do equipamento:</label>
<input type='text' name='ipdoequip' value=''>
<input type='submit' name='btnEnviarDados' value='Enviar'>
</form>
</body>
</html>
PHP GET
<?php
$txtnomedoequip = $_GET["nomedoequip"];
$txtipdoequip = $_GET["ipdoequip"];
echo "O nome do equipamento criado é ".$txtnomedoequip." e o ip é ".$txtipdoequip.;
shell_exec('mkdir /var/www/html/mrtg/.$txtnomedoequip.');
?>