Why is my submit button not working on this form I made in PHP?










0















This one's really stumped me and it's for something that should be relatively simple. I am trying to make a form with nothing but a submit button in the middle of a table I am echoing in PHP. The name of the submit button in this form is being drawn from a database I have a working connection to.



I have tested thoroughly and can confirm the data is coming from the database. I have a couple of other similar forms working fine in the page and they work correctly. When I put this particular form next to those working ones, it works fine. Besides that, I can't get this form to work anywhere else.



Here's the code for my broken form, along with context:



function buildTables($thecategory = "staff")
{
include "db.php";
setlocale(LC_MONETARY, 'en_GB');

$stmt = $mysql->query($_SESSION['query']);
$customercount = 0;
$totalpoints = 0;
$paythismonth = 0;

while ($row = $stmt->fetch())
{
echo'<table><tr><article style="line-height: 0.5em; padding-bottom:2em; background-color:FF7070; color: white; height: 20em; width: 100em; margin-left: 14em">
<div style="display: table-row; color: white">
<div style="display: table-cell; padding-left: 2em; padding-top: 2em">
<p style="font-weight: bold; font-size: 1.8em">'.$row['Forename'].' '.$row['Surname'].'</p>
<p>ID: '.$row['ID'].'</p>
<p>Forename: '.$row['Forename'].'</p>
<p>Surname: '.$row['Surname'].'</p>';

if ($thecategory == "staff")

echo '</div><div style="display: table-cell; padding-left: 20em; padding-top: 2em"><br><br><p style="font-weight: bold; font-size: 1.2em">Emergency Contact</p>
<p>Forename: '.$row['Emergency Forename'].'</p>
<p>Surname : '.$row['Emergency Surname'].'</p>
<p>Address Line 1 : '.$row['Emergency Address Line 1'].'</p>
<p>Address Line 2 : '.$row['Emergency Address Line 2'].'</p>
<p>City: '.$row['Emergency City'].'</p>
<p>Country: '.$row['Emergency Country'].'</p>
<p>Postcode: '.$row['Emergency Postcode'].'</p>

#BROKEN FORM HERE
<form action="editstaff.php" method="post">
<input type="submit" value="Edit staff member" style="font-size: 1.2em" name="'.$row['ID'].'" /></form></div>';



And here's the place elsewhere in my table where I can get forms to work.



 if ($thecategory == "customers")

$customercount+=1;
echo '</div><div style="display: table-cell; padding-left: 20em; padding-top: 2em"><br><br>
<p>Points: '.$row['Points'].'</p>';
$totalpoints += $row['Points'];
$averagepoints = $totalpoints / $customercount;
echo '
<form action="editcustomer.php" method="post">
<input type="submit" value="Edit customer" style="font-size: 1.2em" name="'.$row['ID'].'"></form>
<form action="removecustomer.php" method="post">
<input type="submit" value="Remove customer" style="font-size: 1.2em" name="'.$row['ID'].'"></form></div>';



Just to confirm, this exact sort of code works completely fine elsewhere in my website but here it does not. Any ideas?



EDIT: Here's the entire HTML output of the page:



<head>
<title>Manager</title>
<link rel="stylesheet" type="text/css" href="gamerz-Music.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<font face="Arial Black", Gadget, sans-serif></font>
</head>


<style>

body
background-image: url("blank.png")

</style>


<div class="header">
<img src="logo.png" alt="">

<div class="topnav">
<a class="active" href="#Home">Home</a>
<a href="/2018-ac32006/team7/games.php">Games</a>
<a href="/2018-ac32006/team7/music.php">Music</a>
<a href="/2018-ac32006/team7/tvandmovies.php">TV/FILM</a>
<div class="search-container">
<form action="/action_page.php">
<input type="text" placeholder="Search.." name="search">
<button type="submit"><i class="fa fa-search"></i></button>
</form>
</div>
</div>
</div>

<br><br><br>


<div class="Pop" style="width: 1em; position: fixed; margin-top: 4em">
<form method = "post">
<input type="submit" name="staff" value="View all staff" style="font-size: 1.2em; background-color: pink; height: 3em; width: 10em">
<input type="submit" name="customers" value="View all customers" style="font-size: 1.2em; background-color: pink; height: 3em; width: 10em; margin-top: 1em">
<form>
</div>

<br>CATEGORY = staff<br><table><tr><article style="line-height: 0.5em; padding-bottom:2em; background-color:FF7070; color: white; height: 20em; width: 100em; margin-left: 14em">
<div style="display: table-row; color: white">
<div style="display: table-cell; padding-left: 2em; padding-top: 2em">
<p style="font-weight: bold; font-size: 1.8em">William Shatner</p>
<p>ID: DI3446</p>
<p>Forename: William</p>
<p>Surname: Shatner</p><p>Role: Technician</p>
<p>Date of Birth: 1931-03-22</p>
<p>Date Employed: 2015-02-04</p>
<p>NI Number: OO502044N</p>
<p>Hourly Salary: £10.20</p>
<p>Hours This Month: 40</p><p>Pay so far this month: £408.00</p>
<p>Contact Number: 07987345197</p></div><div style="display: table-cell; padding-left: 20em; padding-top: 2em"><br><br><p style="font-weight: bold; font-size: 1.2em">Contact Details</p>
<p>Address Line 1 : 48 Victoria Road</p>
<p>Address Line 2 : </p>
<p>City : Bath</p>
<p>Country: UK</p>
<p>Postcode: BA56 2SY</p></div><div style="display: table-cell; padding-left: 20em; padding-top: 2em"><br><br><p style="font-weight: bold; font-size: 1.2em">Emergency Contact</p>
<p>Forename: Leonard</p>
<p>Surname : Nimoy</p>
<p>Address Line 1 : 98 East Street</p>
<p>Address Line 2 : </p>
<p>City: Cambridge</p>
<p>Country: UK</p>
<p>Postcode: CM6 0WT</p>
<form method="POST" action="editstaff.php">
<input type="hidden" name="ID" value="DI3446">
<input type="submit" name="submit" value="submit"></form></div></article></tr></table><br>
</body>

<div class="footer">
<a href="Sam">Facebook Page</a>
<br>
<a href="Location"> Dundee DD1 4LA</a>
</div>









share|improve this question
























  • The action methods in a working one and in the broken one look suspitiously different. Also i would advise against echoing that much html code. The same result can be achived easier. PHP code can be inserted to the html markup. And it will be executed on the server side.

    – Eugene Anisiutkin
    Nov 12 '18 at 12:57












  • Can you confirm if the $row['ID'] is correct Id that you want to edit. Also can you elaborate the issue like what's the exact error?

    – Nik
    Nov 12 '18 at 12:58












  • Can you confirm all the values your trying to echo out in PHP do actually exists.

    – Toxide82
    Nov 12 '18 at 13:04











  • putting row['ID'] as a variable name is a very bad idea. try to read code from the editcustomer.php with print_r($_REQUEST); and say what is shows.

    – Alp Altunel
    Nov 12 '18 at 13:07






  • 1





    <table><tr><article — Your HTML is invalid and invalid HTML tables cause massive problems, especially when mixed with forms. Use a validator and don't use tables for layout. 1996 has come, we have CSS now.

    – Quentin
    Nov 12 '18 at 13:34















0















This one's really stumped me and it's for something that should be relatively simple. I am trying to make a form with nothing but a submit button in the middle of a table I am echoing in PHP. The name of the submit button in this form is being drawn from a database I have a working connection to.



I have tested thoroughly and can confirm the data is coming from the database. I have a couple of other similar forms working fine in the page and they work correctly. When I put this particular form next to those working ones, it works fine. Besides that, I can't get this form to work anywhere else.



Here's the code for my broken form, along with context:



function buildTables($thecategory = "staff")
{
include "db.php";
setlocale(LC_MONETARY, 'en_GB');

$stmt = $mysql->query($_SESSION['query']);
$customercount = 0;
$totalpoints = 0;
$paythismonth = 0;

while ($row = $stmt->fetch())
{
echo'<table><tr><article style="line-height: 0.5em; padding-bottom:2em; background-color:FF7070; color: white; height: 20em; width: 100em; margin-left: 14em">
<div style="display: table-row; color: white">
<div style="display: table-cell; padding-left: 2em; padding-top: 2em">
<p style="font-weight: bold; font-size: 1.8em">'.$row['Forename'].' '.$row['Surname'].'</p>
<p>ID: '.$row['ID'].'</p>
<p>Forename: '.$row['Forename'].'</p>
<p>Surname: '.$row['Surname'].'</p>';

if ($thecategory == "staff")

echo '</div><div style="display: table-cell; padding-left: 20em; padding-top: 2em"><br><br><p style="font-weight: bold; font-size: 1.2em">Emergency Contact</p>
<p>Forename: '.$row['Emergency Forename'].'</p>
<p>Surname : '.$row['Emergency Surname'].'</p>
<p>Address Line 1 : '.$row['Emergency Address Line 1'].'</p>
<p>Address Line 2 : '.$row['Emergency Address Line 2'].'</p>
<p>City: '.$row['Emergency City'].'</p>
<p>Country: '.$row['Emergency Country'].'</p>
<p>Postcode: '.$row['Emergency Postcode'].'</p>

#BROKEN FORM HERE
<form action="editstaff.php" method="post">
<input type="submit" value="Edit staff member" style="font-size: 1.2em" name="'.$row['ID'].'" /></form></div>';



And here's the place elsewhere in my table where I can get forms to work.



 if ($thecategory == "customers")

$customercount+=1;
echo '</div><div style="display: table-cell; padding-left: 20em; padding-top: 2em"><br><br>
<p>Points: '.$row['Points'].'</p>';
$totalpoints += $row['Points'];
$averagepoints = $totalpoints / $customercount;
echo '
<form action="editcustomer.php" method="post">
<input type="submit" value="Edit customer" style="font-size: 1.2em" name="'.$row['ID'].'"></form>
<form action="removecustomer.php" method="post">
<input type="submit" value="Remove customer" style="font-size: 1.2em" name="'.$row['ID'].'"></form></div>';



Just to confirm, this exact sort of code works completely fine elsewhere in my website but here it does not. Any ideas?



EDIT: Here's the entire HTML output of the page:



<head>
<title>Manager</title>
<link rel="stylesheet" type="text/css" href="gamerz-Music.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<font face="Arial Black", Gadget, sans-serif></font>
</head>


<style>

body
background-image: url("blank.png")

</style>


<div class="header">
<img src="logo.png" alt="">

<div class="topnav">
<a class="active" href="#Home">Home</a>
<a href="/2018-ac32006/team7/games.php">Games</a>
<a href="/2018-ac32006/team7/music.php">Music</a>
<a href="/2018-ac32006/team7/tvandmovies.php">TV/FILM</a>
<div class="search-container">
<form action="/action_page.php">
<input type="text" placeholder="Search.." name="search">
<button type="submit"><i class="fa fa-search"></i></button>
</form>
</div>
</div>
</div>

<br><br><br>


<div class="Pop" style="width: 1em; position: fixed; margin-top: 4em">
<form method = "post">
<input type="submit" name="staff" value="View all staff" style="font-size: 1.2em; background-color: pink; height: 3em; width: 10em">
<input type="submit" name="customers" value="View all customers" style="font-size: 1.2em; background-color: pink; height: 3em; width: 10em; margin-top: 1em">
<form>
</div>

<br>CATEGORY = staff<br><table><tr><article style="line-height: 0.5em; padding-bottom:2em; background-color:FF7070; color: white; height: 20em; width: 100em; margin-left: 14em">
<div style="display: table-row; color: white">
<div style="display: table-cell; padding-left: 2em; padding-top: 2em">
<p style="font-weight: bold; font-size: 1.8em">William Shatner</p>
<p>ID: DI3446</p>
<p>Forename: William</p>
<p>Surname: Shatner</p><p>Role: Technician</p>
<p>Date of Birth: 1931-03-22</p>
<p>Date Employed: 2015-02-04</p>
<p>NI Number: OO502044N</p>
<p>Hourly Salary: £10.20</p>
<p>Hours This Month: 40</p><p>Pay so far this month: £408.00</p>
<p>Contact Number: 07987345197</p></div><div style="display: table-cell; padding-left: 20em; padding-top: 2em"><br><br><p style="font-weight: bold; font-size: 1.2em">Contact Details</p>
<p>Address Line 1 : 48 Victoria Road</p>
<p>Address Line 2 : </p>
<p>City : Bath</p>
<p>Country: UK</p>
<p>Postcode: BA56 2SY</p></div><div style="display: table-cell; padding-left: 20em; padding-top: 2em"><br><br><p style="font-weight: bold; font-size: 1.2em">Emergency Contact</p>
<p>Forename: Leonard</p>
<p>Surname : Nimoy</p>
<p>Address Line 1 : 98 East Street</p>
<p>Address Line 2 : </p>
<p>City: Cambridge</p>
<p>Country: UK</p>
<p>Postcode: CM6 0WT</p>
<form method="POST" action="editstaff.php">
<input type="hidden" name="ID" value="DI3446">
<input type="submit" name="submit" value="submit"></form></div></article></tr></table><br>
</body>

<div class="footer">
<a href="Sam">Facebook Page</a>
<br>
<a href="Location"> Dundee DD1 4LA</a>
</div>









share|improve this question
























  • The action methods in a working one and in the broken one look suspitiously different. Also i would advise against echoing that much html code. The same result can be achived easier. PHP code can be inserted to the html markup. And it will be executed on the server side.

    – Eugene Anisiutkin
    Nov 12 '18 at 12:57












  • Can you confirm if the $row['ID'] is correct Id that you want to edit. Also can you elaborate the issue like what's the exact error?

    – Nik
    Nov 12 '18 at 12:58












  • Can you confirm all the values your trying to echo out in PHP do actually exists.

    – Toxide82
    Nov 12 '18 at 13:04











  • putting row['ID'] as a variable name is a very bad idea. try to read code from the editcustomer.php with print_r($_REQUEST); and say what is shows.

    – Alp Altunel
    Nov 12 '18 at 13:07






  • 1





    <table><tr><article — Your HTML is invalid and invalid HTML tables cause massive problems, especially when mixed with forms. Use a validator and don't use tables for layout. 1996 has come, we have CSS now.

    – Quentin
    Nov 12 '18 at 13:34













0












0








0








This one's really stumped me and it's for something that should be relatively simple. I am trying to make a form with nothing but a submit button in the middle of a table I am echoing in PHP. The name of the submit button in this form is being drawn from a database I have a working connection to.



I have tested thoroughly and can confirm the data is coming from the database. I have a couple of other similar forms working fine in the page and they work correctly. When I put this particular form next to those working ones, it works fine. Besides that, I can't get this form to work anywhere else.



Here's the code for my broken form, along with context:



function buildTables($thecategory = "staff")
{
include "db.php";
setlocale(LC_MONETARY, 'en_GB');

$stmt = $mysql->query($_SESSION['query']);
$customercount = 0;
$totalpoints = 0;
$paythismonth = 0;

while ($row = $stmt->fetch())
{
echo'<table><tr><article style="line-height: 0.5em; padding-bottom:2em; background-color:FF7070; color: white; height: 20em; width: 100em; margin-left: 14em">
<div style="display: table-row; color: white">
<div style="display: table-cell; padding-left: 2em; padding-top: 2em">
<p style="font-weight: bold; font-size: 1.8em">'.$row['Forename'].' '.$row['Surname'].'</p>
<p>ID: '.$row['ID'].'</p>
<p>Forename: '.$row['Forename'].'</p>
<p>Surname: '.$row['Surname'].'</p>';

if ($thecategory == "staff")

echo '</div><div style="display: table-cell; padding-left: 20em; padding-top: 2em"><br><br><p style="font-weight: bold; font-size: 1.2em">Emergency Contact</p>
<p>Forename: '.$row['Emergency Forename'].'</p>
<p>Surname : '.$row['Emergency Surname'].'</p>
<p>Address Line 1 : '.$row['Emergency Address Line 1'].'</p>
<p>Address Line 2 : '.$row['Emergency Address Line 2'].'</p>
<p>City: '.$row['Emergency City'].'</p>
<p>Country: '.$row['Emergency Country'].'</p>
<p>Postcode: '.$row['Emergency Postcode'].'</p>

#BROKEN FORM HERE
<form action="editstaff.php" method="post">
<input type="submit" value="Edit staff member" style="font-size: 1.2em" name="'.$row['ID'].'" /></form></div>';



And here's the place elsewhere in my table where I can get forms to work.



 if ($thecategory == "customers")

$customercount+=1;
echo '</div><div style="display: table-cell; padding-left: 20em; padding-top: 2em"><br><br>
<p>Points: '.$row['Points'].'</p>';
$totalpoints += $row['Points'];
$averagepoints = $totalpoints / $customercount;
echo '
<form action="editcustomer.php" method="post">
<input type="submit" value="Edit customer" style="font-size: 1.2em" name="'.$row['ID'].'"></form>
<form action="removecustomer.php" method="post">
<input type="submit" value="Remove customer" style="font-size: 1.2em" name="'.$row['ID'].'"></form></div>';



Just to confirm, this exact sort of code works completely fine elsewhere in my website but here it does not. Any ideas?



EDIT: Here's the entire HTML output of the page:



<head>
<title>Manager</title>
<link rel="stylesheet" type="text/css" href="gamerz-Music.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<font face="Arial Black", Gadget, sans-serif></font>
</head>


<style>

body
background-image: url("blank.png")

</style>


<div class="header">
<img src="logo.png" alt="">

<div class="topnav">
<a class="active" href="#Home">Home</a>
<a href="/2018-ac32006/team7/games.php">Games</a>
<a href="/2018-ac32006/team7/music.php">Music</a>
<a href="/2018-ac32006/team7/tvandmovies.php">TV/FILM</a>
<div class="search-container">
<form action="/action_page.php">
<input type="text" placeholder="Search.." name="search">
<button type="submit"><i class="fa fa-search"></i></button>
</form>
</div>
</div>
</div>

<br><br><br>


<div class="Pop" style="width: 1em; position: fixed; margin-top: 4em">
<form method = "post">
<input type="submit" name="staff" value="View all staff" style="font-size: 1.2em; background-color: pink; height: 3em; width: 10em">
<input type="submit" name="customers" value="View all customers" style="font-size: 1.2em; background-color: pink; height: 3em; width: 10em; margin-top: 1em">
<form>
</div>

<br>CATEGORY = staff<br><table><tr><article style="line-height: 0.5em; padding-bottom:2em; background-color:FF7070; color: white; height: 20em; width: 100em; margin-left: 14em">
<div style="display: table-row; color: white">
<div style="display: table-cell; padding-left: 2em; padding-top: 2em">
<p style="font-weight: bold; font-size: 1.8em">William Shatner</p>
<p>ID: DI3446</p>
<p>Forename: William</p>
<p>Surname: Shatner</p><p>Role: Technician</p>
<p>Date of Birth: 1931-03-22</p>
<p>Date Employed: 2015-02-04</p>
<p>NI Number: OO502044N</p>
<p>Hourly Salary: £10.20</p>
<p>Hours This Month: 40</p><p>Pay so far this month: £408.00</p>
<p>Contact Number: 07987345197</p></div><div style="display: table-cell; padding-left: 20em; padding-top: 2em"><br><br><p style="font-weight: bold; font-size: 1.2em">Contact Details</p>
<p>Address Line 1 : 48 Victoria Road</p>
<p>Address Line 2 : </p>
<p>City : Bath</p>
<p>Country: UK</p>
<p>Postcode: BA56 2SY</p></div><div style="display: table-cell; padding-left: 20em; padding-top: 2em"><br><br><p style="font-weight: bold; font-size: 1.2em">Emergency Contact</p>
<p>Forename: Leonard</p>
<p>Surname : Nimoy</p>
<p>Address Line 1 : 98 East Street</p>
<p>Address Line 2 : </p>
<p>City: Cambridge</p>
<p>Country: UK</p>
<p>Postcode: CM6 0WT</p>
<form method="POST" action="editstaff.php">
<input type="hidden" name="ID" value="DI3446">
<input type="submit" name="submit" value="submit"></form></div></article></tr></table><br>
</body>

<div class="footer">
<a href="Sam">Facebook Page</a>
<br>
<a href="Location"> Dundee DD1 4LA</a>
</div>









share|improve this question
















This one's really stumped me and it's for something that should be relatively simple. I am trying to make a form with nothing but a submit button in the middle of a table I am echoing in PHP. The name of the submit button in this form is being drawn from a database I have a working connection to.



I have tested thoroughly and can confirm the data is coming from the database. I have a couple of other similar forms working fine in the page and they work correctly. When I put this particular form next to those working ones, it works fine. Besides that, I can't get this form to work anywhere else.



Here's the code for my broken form, along with context:



function buildTables($thecategory = "staff")
{
include "db.php";
setlocale(LC_MONETARY, 'en_GB');

$stmt = $mysql->query($_SESSION['query']);
$customercount = 0;
$totalpoints = 0;
$paythismonth = 0;

while ($row = $stmt->fetch())
{
echo'<table><tr><article style="line-height: 0.5em; padding-bottom:2em; background-color:FF7070; color: white; height: 20em; width: 100em; margin-left: 14em">
<div style="display: table-row; color: white">
<div style="display: table-cell; padding-left: 2em; padding-top: 2em">
<p style="font-weight: bold; font-size: 1.8em">'.$row['Forename'].' '.$row['Surname'].'</p>
<p>ID: '.$row['ID'].'</p>
<p>Forename: '.$row['Forename'].'</p>
<p>Surname: '.$row['Surname'].'</p>';

if ($thecategory == "staff")

echo '</div><div style="display: table-cell; padding-left: 20em; padding-top: 2em"><br><br><p style="font-weight: bold; font-size: 1.2em">Emergency Contact</p>
<p>Forename: '.$row['Emergency Forename'].'</p>
<p>Surname : '.$row['Emergency Surname'].'</p>
<p>Address Line 1 : '.$row['Emergency Address Line 1'].'</p>
<p>Address Line 2 : '.$row['Emergency Address Line 2'].'</p>
<p>City: '.$row['Emergency City'].'</p>
<p>Country: '.$row['Emergency Country'].'</p>
<p>Postcode: '.$row['Emergency Postcode'].'</p>

#BROKEN FORM HERE
<form action="editstaff.php" method="post">
<input type="submit" value="Edit staff member" style="font-size: 1.2em" name="'.$row['ID'].'" /></form></div>';



And here's the place elsewhere in my table where I can get forms to work.



 if ($thecategory == "customers")

$customercount+=1;
echo '</div><div style="display: table-cell; padding-left: 20em; padding-top: 2em"><br><br>
<p>Points: '.$row['Points'].'</p>';
$totalpoints += $row['Points'];
$averagepoints = $totalpoints / $customercount;
echo '
<form action="editcustomer.php" method="post">
<input type="submit" value="Edit customer" style="font-size: 1.2em" name="'.$row['ID'].'"></form>
<form action="removecustomer.php" method="post">
<input type="submit" value="Remove customer" style="font-size: 1.2em" name="'.$row['ID'].'"></form></div>';



Just to confirm, this exact sort of code works completely fine elsewhere in my website but here it does not. Any ideas?



EDIT: Here's the entire HTML output of the page:



<head>
<title>Manager</title>
<link rel="stylesheet" type="text/css" href="gamerz-Music.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<font face="Arial Black", Gadget, sans-serif></font>
</head>


<style>

body
background-image: url("blank.png")

</style>


<div class="header">
<img src="logo.png" alt="">

<div class="topnav">
<a class="active" href="#Home">Home</a>
<a href="/2018-ac32006/team7/games.php">Games</a>
<a href="/2018-ac32006/team7/music.php">Music</a>
<a href="/2018-ac32006/team7/tvandmovies.php">TV/FILM</a>
<div class="search-container">
<form action="/action_page.php">
<input type="text" placeholder="Search.." name="search">
<button type="submit"><i class="fa fa-search"></i></button>
</form>
</div>
</div>
</div>

<br><br><br>


<div class="Pop" style="width: 1em; position: fixed; margin-top: 4em">
<form method = "post">
<input type="submit" name="staff" value="View all staff" style="font-size: 1.2em; background-color: pink; height: 3em; width: 10em">
<input type="submit" name="customers" value="View all customers" style="font-size: 1.2em; background-color: pink; height: 3em; width: 10em; margin-top: 1em">
<form>
</div>

<br>CATEGORY = staff<br><table><tr><article style="line-height: 0.5em; padding-bottom:2em; background-color:FF7070; color: white; height: 20em; width: 100em; margin-left: 14em">
<div style="display: table-row; color: white">
<div style="display: table-cell; padding-left: 2em; padding-top: 2em">
<p style="font-weight: bold; font-size: 1.8em">William Shatner</p>
<p>ID: DI3446</p>
<p>Forename: William</p>
<p>Surname: Shatner</p><p>Role: Technician</p>
<p>Date of Birth: 1931-03-22</p>
<p>Date Employed: 2015-02-04</p>
<p>NI Number: OO502044N</p>
<p>Hourly Salary: £10.20</p>
<p>Hours This Month: 40</p><p>Pay so far this month: £408.00</p>
<p>Contact Number: 07987345197</p></div><div style="display: table-cell; padding-left: 20em; padding-top: 2em"><br><br><p style="font-weight: bold; font-size: 1.2em">Contact Details</p>
<p>Address Line 1 : 48 Victoria Road</p>
<p>Address Line 2 : </p>
<p>City : Bath</p>
<p>Country: UK</p>
<p>Postcode: BA56 2SY</p></div><div style="display: table-cell; padding-left: 20em; padding-top: 2em"><br><br><p style="font-weight: bold; font-size: 1.2em">Emergency Contact</p>
<p>Forename: Leonard</p>
<p>Surname : Nimoy</p>
<p>Address Line 1 : 98 East Street</p>
<p>Address Line 2 : </p>
<p>City: Cambridge</p>
<p>Country: UK</p>
<p>Postcode: CM6 0WT</p>
<form method="POST" action="editstaff.php">
<input type="hidden" name="ID" value="DI3446">
<input type="submit" name="submit" value="submit"></form></div></article></tr></table><br>
</body>

<div class="footer">
<a href="Sam">Facebook Page</a>
<br>
<a href="Location"> Dundee DD1 4LA</a>
</div>






php html






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 '18 at 13:30







samgl

















asked Nov 12 '18 at 12:51









samglsamgl

12




12












  • The action methods in a working one and in the broken one look suspitiously different. Also i would advise against echoing that much html code. The same result can be achived easier. PHP code can be inserted to the html markup. And it will be executed on the server side.

    – Eugene Anisiutkin
    Nov 12 '18 at 12:57












  • Can you confirm if the $row['ID'] is correct Id that you want to edit. Also can you elaborate the issue like what's the exact error?

    – Nik
    Nov 12 '18 at 12:58












  • Can you confirm all the values your trying to echo out in PHP do actually exists.

    – Toxide82
    Nov 12 '18 at 13:04











  • putting row['ID'] as a variable name is a very bad idea. try to read code from the editcustomer.php with print_r($_REQUEST); and say what is shows.

    – Alp Altunel
    Nov 12 '18 at 13:07






  • 1





    <table><tr><article — Your HTML is invalid and invalid HTML tables cause massive problems, especially when mixed with forms. Use a validator and don't use tables for layout. 1996 has come, we have CSS now.

    – Quentin
    Nov 12 '18 at 13:34

















  • The action methods in a working one and in the broken one look suspitiously different. Also i would advise against echoing that much html code. The same result can be achived easier. PHP code can be inserted to the html markup. And it will be executed on the server side.

    – Eugene Anisiutkin
    Nov 12 '18 at 12:57












  • Can you confirm if the $row['ID'] is correct Id that you want to edit. Also can you elaborate the issue like what's the exact error?

    – Nik
    Nov 12 '18 at 12:58












  • Can you confirm all the values your trying to echo out in PHP do actually exists.

    – Toxide82
    Nov 12 '18 at 13:04











  • putting row['ID'] as a variable name is a very bad idea. try to read code from the editcustomer.php with print_r($_REQUEST); and say what is shows.

    – Alp Altunel
    Nov 12 '18 at 13:07






  • 1





    <table><tr><article — Your HTML is invalid and invalid HTML tables cause massive problems, especially when mixed with forms. Use a validator and don't use tables for layout. 1996 has come, we have CSS now.

    – Quentin
    Nov 12 '18 at 13:34
















The action methods in a working one and in the broken one look suspitiously different. Also i would advise against echoing that much html code. The same result can be achived easier. PHP code can be inserted to the html markup. And it will be executed on the server side.

– Eugene Anisiutkin
Nov 12 '18 at 12:57






The action methods in a working one and in the broken one look suspitiously different. Also i would advise against echoing that much html code. The same result can be achived easier. PHP code can be inserted to the html markup. And it will be executed on the server side.

– Eugene Anisiutkin
Nov 12 '18 at 12:57














Can you confirm if the $row['ID'] is correct Id that you want to edit. Also can you elaborate the issue like what's the exact error?

– Nik
Nov 12 '18 at 12:58






Can you confirm if the $row['ID'] is correct Id that you want to edit. Also can you elaborate the issue like what's the exact error?

– Nik
Nov 12 '18 at 12:58














Can you confirm all the values your trying to echo out in PHP do actually exists.

– Toxide82
Nov 12 '18 at 13:04





Can you confirm all the values your trying to echo out in PHP do actually exists.

– Toxide82
Nov 12 '18 at 13:04













putting row['ID'] as a variable name is a very bad idea. try to read code from the editcustomer.php with print_r($_REQUEST); and say what is shows.

– Alp Altunel
Nov 12 '18 at 13:07





putting row['ID'] as a variable name is a very bad idea. try to read code from the editcustomer.php with print_r($_REQUEST); and say what is shows.

– Alp Altunel
Nov 12 '18 at 13:07




1




1





<table><tr><article — Your HTML is invalid and invalid HTML tables cause massive problems, especially when mixed with forms. Use a validator and don't use tables for layout. 1996 has come, we have CSS now.

– Quentin
Nov 12 '18 at 13:34





<table><tr><article — Your HTML is invalid and invalid HTML tables cause massive problems, especially when mixed with forms. Use a validator and don't use tables for layout. 1996 has come, we have CSS now.

– Quentin
Nov 12 '18 at 13:34












1 Answer
1






active

oldest

votes


















0














The question is simple. In order to submit a form you have to put your button between <form></form> tags like below:



<form method="POST" action="your_file.php">
<input type="hidden" name="ID" value=".$row['ID'].">
<input type="submit" name="submit" value="submit">
</form>


A better approach by putting a tag like:



 <a href="your_file.php?ID=".$row['ID']."&action=edit">edit</a>
<a href="your_file.php?ID=".$row['ID']."&action=remove">remove</a>





share|improve this answer

























  • As far as I see tags are not the proplem. The tags are there. They are inside the giant echo.

    – Eugene Anisiutkin
    Nov 12 '18 at 13:05












  • Yeah sorry about that awful echo. But still no luck. Clicking on the submit button does nothing.

    – samgl
    Nov 12 '18 at 13:10











  • can you put a code from browser's html output? (ctrl-u or rightclick show page source)

    – Alp Altunel
    Nov 12 '18 at 13:21










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53262575%2fwhy-is-my-submit-button-not-working-on-this-form-i-made-in-php%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














The question is simple. In order to submit a form you have to put your button between <form></form> tags like below:



<form method="POST" action="your_file.php">
<input type="hidden" name="ID" value=".$row['ID'].">
<input type="submit" name="submit" value="submit">
</form>


A better approach by putting a tag like:



 <a href="your_file.php?ID=".$row['ID']."&action=edit">edit</a>
<a href="your_file.php?ID=".$row['ID']."&action=remove">remove</a>





share|improve this answer

























  • As far as I see tags are not the proplem. The tags are there. They are inside the giant echo.

    – Eugene Anisiutkin
    Nov 12 '18 at 13:05












  • Yeah sorry about that awful echo. But still no luck. Clicking on the submit button does nothing.

    – samgl
    Nov 12 '18 at 13:10











  • can you put a code from browser's html output? (ctrl-u or rightclick show page source)

    – Alp Altunel
    Nov 12 '18 at 13:21















0














The question is simple. In order to submit a form you have to put your button between <form></form> tags like below:



<form method="POST" action="your_file.php">
<input type="hidden" name="ID" value=".$row['ID'].">
<input type="submit" name="submit" value="submit">
</form>


A better approach by putting a tag like:



 <a href="your_file.php?ID=".$row['ID']."&action=edit">edit</a>
<a href="your_file.php?ID=".$row['ID']."&action=remove">remove</a>





share|improve this answer

























  • As far as I see tags are not the proplem. The tags are there. They are inside the giant echo.

    – Eugene Anisiutkin
    Nov 12 '18 at 13:05












  • Yeah sorry about that awful echo. But still no luck. Clicking on the submit button does nothing.

    – samgl
    Nov 12 '18 at 13:10











  • can you put a code from browser's html output? (ctrl-u or rightclick show page source)

    – Alp Altunel
    Nov 12 '18 at 13:21













0












0








0







The question is simple. In order to submit a form you have to put your button between <form></form> tags like below:



<form method="POST" action="your_file.php">
<input type="hidden" name="ID" value=".$row['ID'].">
<input type="submit" name="submit" value="submit">
</form>


A better approach by putting a tag like:



 <a href="your_file.php?ID=".$row['ID']."&action=edit">edit</a>
<a href="your_file.php?ID=".$row['ID']."&action=remove">remove</a>





share|improve this answer















The question is simple. In order to submit a form you have to put your button between <form></form> tags like below:



<form method="POST" action="your_file.php">
<input type="hidden" name="ID" value=".$row['ID'].">
<input type="submit" name="submit" value="submit">
</form>


A better approach by putting a tag like:



 <a href="your_file.php?ID=".$row['ID']."&action=edit">edit</a>
<a href="your_file.php?ID=".$row['ID']."&action=remove">remove</a>






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 12 '18 at 13:05

























answered Nov 12 '18 at 13:01









Alp AltunelAlp Altunel

735816




735816












  • As far as I see tags are not the proplem. The tags are there. They are inside the giant echo.

    – Eugene Anisiutkin
    Nov 12 '18 at 13:05












  • Yeah sorry about that awful echo. But still no luck. Clicking on the submit button does nothing.

    – samgl
    Nov 12 '18 at 13:10











  • can you put a code from browser's html output? (ctrl-u or rightclick show page source)

    – Alp Altunel
    Nov 12 '18 at 13:21

















  • As far as I see tags are not the proplem. The tags are there. They are inside the giant echo.

    – Eugene Anisiutkin
    Nov 12 '18 at 13:05












  • Yeah sorry about that awful echo. But still no luck. Clicking on the submit button does nothing.

    – samgl
    Nov 12 '18 at 13:10











  • can you put a code from browser's html output? (ctrl-u or rightclick show page source)

    – Alp Altunel
    Nov 12 '18 at 13:21
















As far as I see tags are not the proplem. The tags are there. They are inside the giant echo.

– Eugene Anisiutkin
Nov 12 '18 at 13:05






As far as I see tags are not the proplem. The tags are there. They are inside the giant echo.

– Eugene Anisiutkin
Nov 12 '18 at 13:05














Yeah sorry about that awful echo. But still no luck. Clicking on the submit button does nothing.

– samgl
Nov 12 '18 at 13:10





Yeah sorry about that awful echo. But still no luck. Clicking on the submit button does nothing.

– samgl
Nov 12 '18 at 13:10













can you put a code from browser's html output? (ctrl-u or rightclick show page source)

– Alp Altunel
Nov 12 '18 at 13:21





can you put a code from browser's html output? (ctrl-u or rightclick show page source)

– Alp Altunel
Nov 12 '18 at 13:21

















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53262575%2fwhy-is-my-submit-button-not-working-on-this-form-i-made-in-php%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

Syphilis

Darth Vader #20