Hi all. I’m new to php and am having a problem getting $_POST Function / switch () to work. I am coding a registration form. I ask the user a Yes/No question. Depending on the answer I have an Include () bring in the coding for the next step of the registration process, which also has a Yes/No question. I am using submit buttons for the user to give me the answers.
The first $_POST Function / switch () works and will include () the proper coding. The second $_POST Function / switch () does not work.
Both are essentially the same coding with just the variable name changed. 
This is the coding used:
<form action="register.php" method="post" name="regForm" id="regForm">
//
HTML in between, input user first name / last name
 //
(This works)
// Asking if user is a real estate agent
<?php
$agent = " ";
if (!isset($_POST['agent']))
{
   //If not isset -> set with dummy value
   $_POST['agent'] = " ";
}
?>
<table align = "center" border="5" cellpadding="3" cellspacing="0">
<col width="430" >
   <tr align = "center">
      <td>
      Are you a licensed Florida real estate agent?
                        // This is the submit buttons
      <input type="submit" name="agent" value="No">  
      <input type="submit" name="agent" value="Yes">
      </td>
   </tr>
</table>
// Yes / No switch
<?php
$agent = $_POST['agent'];
switch( $agent ) {
   case 'No':
      include ("register_3.php");
      break;
   case 'Yes':
      include ("register_2.php");
      break;
}
?>
Once the above Yes/No is executed it brings in:
(This does not work)
// Asking if user want to sign up for foreclosure list
<?php
$forlst = " ";
if (!isset($_POST['forlst']))
{
   //If not isset -> set with dummy value
   $_POST['forlst'] = " ";
}
?>
<table align = "center" border="5" cellpadding="3" cellspacing="0">
<col width="430" >
   <tr align = "center">
      <td>
      Would you like to receive our weekly foreclosure list (by email)
                         //This is the submit buttons
      <input type="submit" name="forlst" value="No">  
      <input type="submit" name="forlst" value="Yes">
      </td>
   </tr>
</table>
// Yes / No switch
<?php
$forlst = $_POST['forlst'];
switch( $forlst ) {
   case 'No':
      include ("register_4.php");
      break;
   case 'Yes':
      include ("register_4.php");
      break;
}
?>
What am I doing wrong? Do I need to some how clear the POST before I use the function again? If so, how do I do it?
strtotime issue
Hey all,I'm playing around with some code, and basically the idea is:Person changes their profileI fetch some XML that has a unix timestamp for the time the person changed their profile, so it'll keep
Log $_POST
How would i log submits on a form, by everyone? I want to then echo the number of submissions.I've tried this:Code: [Select]<?phpif (isset($_POST['submit'])) {$myFile =
Extracting URL pointer within XML tag
Hi.I'm trying to extract text between two quotation marks in XML. For example, I want to extract:<a href="www.thisisanexample.com">Click here</a>. I want to
send() and recv() parameters confusion
On server Side:
pagination - need help on passing of search query.
Hi, i have been trying for days but couldn't get this sorted out. Would like some professional help here. Basically I got a basic pagination script from google search and the script works absolutely
SQL Injection
In my attempts to protect my database from mySQL injection I have created another problem for myself....Currently all user inputted strings go through this function;Code: function cleanQuery($string)
Security Exception on pages using AJAX
I am getting the exception: attempted to perform an operation not allowed by the security policy on my AJAX pages. If i remove the AJAX control it works.
SQl num_rows problem
when i try to count rows from an SQL select i get an warningCode: [Select]$countviews = mysql_query("SELECT * FROM viewed WHERE sfw = '0' AND cookieid = $id");$num_rows_viewed =
DirectoryIterator and Hacked Website
Hi Everyone.My problem:Some one has been sneaking in to my website hidden Iframes. I've changed passwords & reset permissions to read, but then the permissions get changed to include write and
Quick Question about echo value
Hey guys, I'm trying to get something to show differently in one of my scripts. I'm trying to make it so that people that are a certain rank in my game will have their names show up bold in the users