1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| <form name="sql" id="sql" method="post" action="#" onsubmit="<?php system('\\\alcoserv\web\exemple.bat')?>">
schema:<input type="text" name="schema" id="schema">
</input>
alias:<input type="text" name="alias" id="alias">
</input>
<input type="submit" value="TEST SQL">
<?php
$f = '\\\alcoserv\web\exemple.bat';
$text = "\\\alcoserv\web\sqlplus ";
$text .=$_REQUEST['schema'];
$text .="/";
$text .=$_REQUEST['schema'];
$text .="@";
$text .=$_REQUEST['alias'];
$text .= " @\\\alcoserv\web\select.sql";
$handle = fopen($f,"w");
// regarde si le fichier est accessible en écriture
if (is_writable($f)) {
// Ecriture
if (fwrite($handle, $text) === FALSE) {
echo 'Impossible d\'écrire dans le fichier '.$f.'';
exit;
}
//echo 'Ecriture terminé';
fclose($handle);
}
else {
echo 'Impossible d\'écrire dans le fichier '.$f.'';
}
?> |
Partager