Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP Not Sending POST data
    primarykey
    data
    text
    <p>I've finally got the first page of my registration page working. The user <strong>has</strong> to select one of three options before continuing to the next page. The problem I am having <em>now</em> is that the first page is not sending the data to the next page. Here is the code for</p> <p>Registration_1.php:</p> <pre><code>$reg_type = ""; if ($_SERVER["REQUEST_METHOD"] == "POST") { if (!empty($_POST["Reg_type"])) { //$reg_type=$_POST["Reg_type"]; //header('Location: Registration_2.php?rtype='.$reg_type); $reg_type=$_POST["Reg_type"]; header('Location: Registration_2.php'); } } ?&gt; &lt;form name="frmtype" action="&lt;?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?&gt;" method="post" &gt; &lt;input type="radio" name="Reg_type" value="1"/&gt; Registering myself with credit card or bank account &lt;br/&gt; &lt;input type="radio" name="Reg_type" value="2"/&gt; Registering multiple people using credit card or bank account &lt;br/&gt; &lt;input type="radio" name="Reg_type" value="3"/&gt; Registering multiple people using a purchase order &lt;br/&gt; &lt;input type="submit" name="Submit" value="Submit" /&gt; &lt;?php if(isset($_POST["Submit"]) &amp;&amp; !isset($_POST["Reg_type"])) echo "Please select an option"; ?&gt; &lt;/form&gt; </code></pre> <p>Registration_2.php</p> <pre><code>&lt;?php $regtype=$_POST["Reg_type"]; echo "regtype value is:" . $regtype; if($regtype==1) { ?&gt; </code></pre> <p>However regtype is blank, meaning i'm not getting any data from the previous page. Can anyone tell me what the problem is?</p>
    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.
 

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