Eléphant du PHP |
134 Messages
05 août 2013, 13:52
en gros dans mon fichier script.php j'ai
<?php
// $bin = $_POST['bin'];
$path = $_POST['path'];
$user = $_POST['alias'];
$screen = $_POST['screen'];
$choix = $_POST['choix'];
$choix = $_POST['choix'];
if( $choix == '1' ){
$reponse = 'http://fichier1.com/fichier1.txt';
}else if( $choix == '2' ){
$reponse = 'http://fichier1.com/fichier2.txt';
}else{
echo 'Choix impossible';
}
echo 'vous avez choisi:',$reponse;
$test = ssh2_exec($connection, "mkdir " . $user " && cd " . $user . " && wget " . $choix );
if (isset($_POST['go'])) {
echo stream_get_contents($test);
}
?>
et dans mon test.php j'ai
<form method="post" action="script.php">
<fieldset>
<p><label>Alias :</label><input type="text" class="text-medium" name="alias" id="alias" /></p>
<p><label>Type :</label><select name="choix" id="choix">
<option value="1" id="choix1">choix1</option>
<option value="2" id="choix2">choix2</option>
</select></p>
</fieldset>
<fieldset>
<p><label>Exécutable du serveur :</label><input type="text" class="text-medium" name="bin" id="bin" /></p>
<p><label>Répertoire de l'éxécutable :</label><input type="text" class="text-medium" name="path" id="path"/></p>
<p><label>Options de lancement :</label><textarea name="options" id="options"></textarea></p>
<p><label>Nom du screen :</label><input type="text" class="text-medium" name="screen" id="screen"/></p>
</fieldset>
<button type="submit" name="go" class="button" value="" id="go"> Ajouter ce serveur</button> <button type="reset" class="button negative">Reset des champs</button>
</form>
dans mes logs j'ai toujours ce retour d'erreur
PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in 26
en gros il me dit que j'ai un soucis sur
$test = ssh2_exec($connection, "mkdir " . $user " && cd " . $user . " && wget " . $choix );