1
私はemail
とpassword
フィールドのカスタムログインとサインアップフォームを持っています。どうすればWooCommerceのサインインと登録フォームとして使用できますか?Sign In
ボタンをクリックすると、ストアのすべての商品が表示されますか?WooCommerceカスタムログインとサインアップ
global $wpdb;
if($_SERVER["REQUEST_METHOD"] == "POST") {
$username = $wpdb->escape($_REQUEST['username']);
$password = $wpdb->escape($_REQUEST['password']);
$_SESSION['username'] = $username;
$wpdb->get_results("select * from wp_registration where Email='$username' AND Password='$password'");
$count= $wpdb->num_rows;
if($count == 1) {
echo"<script>alert('Welcome')</script>";
header('Location:index.php');
}
else {
echo"<script>alert('Incorrect Username or Password!')</script>";
}
}
?>
<input type="text" style="font-size: xx-large !important;" placeholder="Username" onfocus="this.placeholder=''" onblur="this.placeholder = 'Username'" name="username" required>
<input type="password" style="font-size: xx-large !important;" placeholder="password" onfocus="this.placeholder=''" onblur="this.placeholder = 'password'" name="password" required>
<span class="psw"><input type="submit">Submit</span>