So I have user submitted info passed through the url that then goes into a form and they hit submit if they want to delete this record but the delete query is not executing?
Here is my code:
<?php
$unique_id = $_SESSION['unique_id'];
$date = $_GET['date'];
$steps = $_GET['steps']; } ?>
<h2>Delete Steps</h2>
<div class="form">
<form id="deletesteps" action="deletesteps.php" method="post" autocomplete="off">
<div class="field-wrap">
<label>
Date:
</label>
<input type="date" required autocomplete="off" name="date" value="<?php echo $date ?>" readonly="readonly"/>
</div>
<div class="field-wrap">
<label>
Steps:
</label>
<input type="number" required autocomplete="off" name="steps" value="<?php echo $steps ?>" readonly="readonly"/>
</div>
<div class="field-wrap">
<button type="submit" class="button button-block" name="submit" />Delete?</button>
</div>
</form>
</div>
<?php
if(isset($_POST['submit'])){
$sql = $link->query("DELETE FROM step_count WHERE steps = '$steps' AND date = '$date' AND unique_id = '$unique_id'");
header('Location: nextpage.php'); } ?>