[Solved] Pass a variable through the url bar with PHP to a form [closed]


Your get Variable is wrong. You should also check if the get variable is set.

<?php 
require 'core.inc.php';
if (isset($_GET['id'])
{
$id = $_GET['id']
if (isset($_POST['delete'])) {
    $answer = $_POST['decision'];
    if ($answer == 'yes') {
    echo 'user deleted'; }
} 
echo '<h1>Are you sure you want to delete '.$id.'?</h1>
<form name ="form1" method ="POST" action ="delete.php">
<input type="radio" name="decision" value="yes">Yes
<input type="radio" name="decision" value="no">No
<input type="submit" name="delete" value="Delete">
</form>';
} 

1

solved Pass a variable through the url bar with PHP to a form [closed]