2016-08-25 2 views
-2


未定義可変PHPMakerの、カスタマー・テンプレートに提出

<?php 
if (!isset($_POST['submit1'])==($submit == "Dig Gmail")){ 
if (!function_exists("ssh2_connect")) 
die("function ssh2_connect doesn't exist"); 
$connection = ssh2_connect('x.x.x.x', 22); 
ssh2_auth_password($connection, 'xxxx', 'xxxx'); 
$stream = ssh2_exec($connection, 'dig @127.0.0.1 gmail.com'); 
$errorStream = ssh2_fetch_stream($stream, SSH2_STREAM_STDERR); 
if (stream_set_blocking($stream, true)) { 
echo "<pre>"; 
echo "Output:".stream_get_contents($stream); 
echo "</pre>"; 
} elseif (stream_set_blocking($errorStream, true)) { 
echo "Error:".stream_get_contents($errorStream); 
} else { 
echo "No Output"; 
} fclose($errorStream); 
    fclose($stream); 
} 
?> 

<form action="" method="post"> 
<input type="submit" class="btn btn-success" 
name="submit1" value="Dig Gmail"> 
</form> 

エラーコードのメッセージが
注意ある:未定義の変数:Cに提出:\ XAMPP \ htdocsに\コバ\ home.php線上402
あなたのアドバイスありがとう

+2

[How to ask](http://stackoverflow.com/help/how-to-ask)と[最小限で完全で検証可能な例を作成する方法](http: /stackoverflow.com/help/mvce)。 – NickyvV

+1

この質問には文字通りCSSはありません.Linuxへの接続は気にせず、MySQLはコードのどこにも現れず、JavaScriptコードも全くありません。物事を正しくタグ付けしてください。 – tadman

答えて

0

あなたのフォームの下のフォームから変数を使用していますので、$_POST配列を使用し、fromから提出された変数を含んでください。

上記の例は、安全でないregistre_globalsがオンになっている古いPHPバージョンでは機能します(これは決して良いことではありません)。また、名前が間違っていた。

if (!isset($_POST['submit1'])==($_POST['submit1'] == "Dig Gmail")){ 

にライン

if (!isset($_POST['submit1'])==($submit == "Dig Gmail")){ 

を変更し、それはあなたのために仕事をする必要があります。

+0

あなたのアドバイスにはジャクエーさんに感謝します。 – pujiarahman

関連する問題