2016-03-22 16 views
-1

私はフォームの登録を行うが、私はPHPを使用して値の情報を取得するいくつかの問題を取得、私は他のサーバーにhtmlの値をgrapする必要がありますtxtまたはログファイルに保存知っているとotherserverファイルに私のコードフォーム登録PHPを使用して

<form action="http://otherserver/memek/info.php?log=" method="get" id="form-validate"> 
     <div class="fieldset"> 
      <input name="success_url" value="" type="hidden"> 
      <input name="error_url" value="" type="hidden"> 
      <h2 class="legend">Personal Information</h2> 
      <ul class="form-list"> 
       <li class="fields"> 
        <div class="customer-name"> 
    <div class="field name-firstname"> 
     <label for="firstname" class="required"><em>*</em>First Name</label> 
     <div class="input-box"> 
      <input id="firstname" name="firstname" value="" title="First Name" maxlength="255" class="input-text required-entry" type="text"> 
     </div> 
    </div> 
    <div class="field name-lastname"> 
     <label for="lastname" class="required"><em>*</em>Last Name</label> 
     <div class="input-box"> 
      <input id="lastname" name="lastname" value="" title="Last Name" maxlength="255" class="input-text required-entry" type="text"> 
     </div> 
    </div> 
</div> 

<button type="submit" title="Submit" class="button"><span><span>Submit</span></span></button> 

とPHP用が間違っているところを教えたい誰かが

<?php 
$txt = "reg.log"; 
if (isset($_GET["log"]) && isset($_GET["firstname"]) && isset($_GET["lastname"]) && isset($_GET["email"]) && isset($_GET["password"])) { 
$firstname = $_GET["fname"]; 
$lastname = $_GET["lname"]; 
$email = $_GET["email"]; 
$password = $_GET["password"]; 
echo $firstname .PHP_EOL. $lastname .PHP_EOL. $email .PHP_EOL. $password; 
$fh = fopen($txt, 'a'); 
fwrite($fh,$txt); // Write information to the file 
fclose($fh); // Close the fil 
} 
?> 

コードエラーではありませんが、ログファイルに私が値から情報を取得いけません このようなURLから値を取得する必要があります私はそのURL情報

おかげ

+0

これは多くの理由で間違っています。 –

答えて

0

スポットの違いで私のログファイルに結果を得ることができる方法

:あなたは基本的なデバッグのいずれかの種類を行ってしたい場合は、おそらく

<input id="firstname" name="firstname" value="" title="First Name" maxlength="255" class="input-text required-entry" type="text"> 
         ^^^^^^^^^^^^^^ 

$firstname = $_GET["fname"]; 
        ^^^^^^^ 

、 PHPがこれに対して発行していた "未定義のインデックス"警告に気づいたでしょう。

+0

が完了しましたが、ファイル.log –

+0

の結果が得られませんでした。デバッグを開始します。ファイルが開かれたと仮定して停止します。 –

+0

_and_はdisplay_errorsをオンにし、error_reportingをE_ALL | E_STRICTに設定する(または-1を渡す) –

関連する問題