2017-07-11 10 views
0

私は自分のメールアドレスを入力してから「開始」ボタンを押すと、自分のウェブサイトに「開始ボタン」を作成しています。テキストは、メールフィールドのログインページに転送されます。フォーム内の別のページにテキストを表示させるにはどうすればよいですか?

は、ここに私のボタンのコードです:

    <form method="post" action="#" class="container 50%"> 
         <div class="row uniform 50%"> 
          <div class="8u 12u$(xsmall)"><input type="email" name="email" id="email" placeholder="Your Email Address" /></div> 
          <div class="4u$ 12u$(xsmall)"><input type="button" value="Get Started" class="fit special" onclick="location.href='loginsystem/loginpage.php';"></div> 
         </div> 
        </form> 

そしてここで、ログインページのための私のコードです:

<?php 
/* Main page with two forms: sign up and log in */ 
require 'db.php'; 
session_start(); 
?> 
<!DOCTYPE html> 
<html> 
<head> 
<title>Sign-Up/Login Form</title> 
<?php include 'css/css.html'; ?> 
</head> 
<?php 
if ($_SERVER['REQUEST_METHOD'] == 'POST') 
{ 
if (isset($_POST['login'])) { //user logging in 

    require 'login.php'; 

} 

elseif (isset($_POST['register'])) { //user registering 

    require 'register.php'; 

} 
} 
?> 
<body style="background-color: #1c1d26"> 
<div class="form"> 

    <ul class="tab-group"> 
    <li class="tab"><a href="#signup">Sign Up</a></li> 
    <li class="tab active"><a href="#login">Log In</a></li> 
    </ul> 

    <div class="tab-content"> 

    <div id="login"> 
     <h1>Welcome Back!</h1> 

     <form action="loginpage.php" method="post" autocomplete="off"> 

     <div class="field-wrap"> 
     <label> 
      Email Address<span class="req">*</span> 
     </label> 
     <input type="email" required autocomplete="off" name="email"/> 
     </div> 

     <div class="field-wrap"> 
     <label> 
      Password<span class="req">*</span> 
     </label> 
     <input type="password" required autocomplete="off" name="password"/> 
     </div> 

     <p class="forgot"><a href="forgot.php">Forgot Password?</a></p> 

     <button class="button button-block" name="login" />Log In</button> 

     </form> 

    </div> 

    <div id="signup"> 
     <h1>Sign Up for Free</h1> 

     <form action="loginpage.php" method="post" autocomplete="off"> 

     <div class="top-row"> 
     <div class="field-wrap"> 
      <label> 
      First Name<span class="req">*</span> 
      </label> 
      <input type="text" required autocomplete="off" name='firstname' /> 
     </div> 

     <div class="field-wrap"> 
      <label> 
      Last Name<span class="req">*</span> 
      </label> 
      <input type="text"required autocomplete="off" name='lastname' /> 
     </div> 
     </div> 

     <div class="field-wrap"> 
     <label> 
     Email Address<span class="req">*</span> 
     </label> 
     <input type="email"required autocomplete="off" name='email' /> 
     </div> 

     <div class="field-wrap"> 
     <label> 
     Set A Password<span class="req">*</span> 
     </label> 
     <input type="password"required autocomplete="off" name='password'/> 
     </div> 

     <button type="submit" class="button button-block" name="register" />Register</button> 

     </form> 

    </div> 

    </div><!-- tab-content --> 

    </div> <!-- /form --> 
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'>   </script> 

<script src="js/index.js"></script> 

</body> 
</html> 

ありがとうございます!あなたのGETで

+0

ログインページではaction="yourLoginPage.php"

<form method="post" action="yourLoginPage.php" class="container 50%"> 

を設定して開始しました: //developer.mozilla.org/de/docs/Web/HTML/Element/button)をタイプ= "submit"で実行します。 name = "submit" + [action属性](https://developer.mozilla.org/de/docs/Web/HTML/Element/form)をPHPファイルを指すフォームに追加します。 $ _POST ['submit']を要求し、$ _POST ['email'] - btwから入力データを取得してください。あなたは多分htmlフォームの時間とjsとphpを使用する理由、あるいはそれらのユースケースが何であるかを調査する必要があります;) – MarcelD

答えて

1

form uは、代わりにonclickの内部の場所の変更を行うのは、単にそれが(HTTPS [送信ボタンを]作ることができる

<input type="email" required autocomplete="off" name="email" value="<?php echo $_POST["email"]; ?>"/> 
関連する問題