Hello i have a strange problem i have the following form
echo "<td class='contact-delete'>
<form method='post' action='update_record.php'>";
echo "<button type='submit' value='" . $row['ID_PER'] . "' name='recordID' id = 'recordID'>edit</button>";
echo "</form>";
in the update_record.php I have the following code
$id2update = $_POST['recordID'];
echo $id2update ;
session_start();
if(!$_SESSION['logged']){
header("refresh:3; url=start_page.php" );}
// above this part of code there is an other form with a submit button
else if(isset($_POST['submit'])){
echo $id2update ;
}
The problem is that the first echo outputs the variable as it supposed but the second echo does not output anything it is null. Can anyone give me an explanation?
edit: The 2nd echo is being called but the value is null!
$_SESSION['logged']is set and not null? Do you have error reporting on (E_ALL)?echois called at all? Mayb the condition is never met. Throw some morevar_dumps in between to see how far you code is executed. This question smells like bad debugging…