Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a php file that has a html form
<form action="CustomerLoginHTML.php" method="POST">

once the button click even perform the form should execute the php file inside it.

but it dose not execute the php part, but why?

What I have tried:

<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
    <title>Sign in</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" type="text/css" href="CSS/SSLoginGen.css">
</head>
<?php

if ($_SERVER['REQUEST_METHOD'] == 'POST') 
{
    if (isset($_POST['login'])) { //user logging in

        require 'Custlogin_Dbchk.php';
        
    }
    
    else{
        
        $message = "wait for it";
        echo "<script type='text/javascript'>alert('$message');</script>";
        
    }
}
?> 
<body>


    <form action="CustomerLoginHTML.php" method="POST">
<center>
<div class="loginbox">
 
        <h1>Customer Login</h1>
        <input type="username" name="username" id="username" placeholder="Username" required/><br><br>
        <input type="password" name="password" id="password" placeholder="Password" required/><br><br>
        <input type="button" value="LOGIN" name="login"/><br><br>
    
        <a href="ResetPW.php" style="color:whitesmoke">Forgot your Password?</a><br><br>
        <a href="index.php"><input type="button" value="BACK TO HOME" id="home"/></a>
    
</div>
</center>
</form>
</body>
</html>
Posted
Comments
W Balboos, GHB 23-Jul-17 6:51am    
Since we haven't a clue what is in CustomerLoginHTML.php we cannot answer.
Member 13049972 23-Jul-17 7:36am    
its the same page name

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900