Click here to Skip to main content
15,887,776 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Pls help!! I am creating a form with php and added isset function to echo whether the value can pass through after clicking the button. However, it only echo not clicked. Can anyone pls help??? I am really desparate on this as my homework deadline is coming.

What I have tried:

<form action="" method="POST">

<table class="tbl-30">

<tr>

<td>Full Name: </td>

<td>

<input type="text" name="full_name" placeholder="Please fill in your full name">

</td>

</tr>

<tr>

<td>Username: </td>

<td>

<input type="text" name="username" placeholder="Please fill in your username">

</td>

</tr>

<tr>

<td>Password: </td>

<td>

<input type="password" name="password" placeholder="Please fill in your password">

</td>

</tr>

<tr>

<td colspan="2">

<input type="submit" name="sumbit" value="Add Admin" class="btn-secondary">

</td>

</tr>

</table>

</form>

<?php

//Submit the value from form and insert into database

//Check whether the button is clicked or not

if(isset($_POST['submit']))

{

// if true, button is clicked

echo "Button Clicked";

}

else

{

// if not true, button is not clicked

echo "Button is not Clicked";

}

?>
Posted
Updated 2-Oct-22 9:28am

1 solution

you have a typo in
HPH
<input type="submit" name="sumbit" value="Add Admin" class="btn-secondary">


:)
 
Share this answer
 

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