Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Edited answer to reflect discoveries found in comment thread below for future readers</strong></p> <p>In your PHP files you need to update </p> <pre><code>$_POST[id] </code></pre> <p>to be </p> <pre><code>$_POST['id'] </code></pre> <p>PHP will not now what id is, and therefor will evaluate to false, causing your script to exit, and fall into the loop you are describing.</p> <p>This is also the case when you are using your $_SESSION array</p> <pre><code>$_SESSION[valid] </code></pre> <p>should be</p> <pre><code>$_SESSION['valid'] </code></pre> <p>$_SESSION, $_POST, $_GET, $_REQUEST, etc are all associative arrays, in order to refer to any of their contents you need to specify the string that refers to the key they are located in. </p> <p>Ok, in your if statement</p> <pre><code>if (!$_POST['id']) { header( "Location: pick_modcontact.php"); exit; } else { session_start(); } if ($_SESSION['valid'] != "yes") { header( "Location: pick_modcontact.php"); exit; } </code></pre> <p>You are checking to see if $_SESSION['valid'] does not equal yes, this will evaluate to true because you never set $_SESSION['valid'] = "yes" so it will always go back to pick_modcontact.php here.</p> <p>Try updating it to be </p> <pre><code>if (!$_POST['id']) { header( "Location: pick_modcontact.php"); exit; } else { session_start(); // let the script know that this is a valid contact $_SESSION['valid'] = 'yes'; } if ($_SESSION['valid'] != "yes") { header( "Location: pick_modcontact.php"); exit; } </code></pre> <p>Also</p> <pre><code>$option_block .= "&lt;option value\"$id\"&gt;$f_name, $l_name&lt;/option&gt;"; </code></pre> <p>should be (you're misssing an equals sign) which means that on submit, it wont know the value of 'id'</p> <pre><code>$option_block .= "&lt;option value=\"$id\"&gt;$f_name, $l_name&lt;/option&gt;"; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload