Jump to content

Forms Form and More Forms


swieder

Recommended Posts

In a nutshell, my current project is a backend input form that you choose what questions you want to ask (First Name, Last Name, Email ...etc) which when submitted displays the following form for customers with only the fields of your choosing. The first page is set up in a table like so:

 

<tr>
			<td class="fields">First Name</td>
			<td><input class="display_box" type="checkbox" name="Display[0]" value="fname" /></td>
			<td><input class="req_box" type="checkbox" name="Req[0]" value="fnameR"/></td>
		</tr>

		<tr>
			<td class="fields">Last Name</td>
			<td><input class="display_box" type="checkbox" name="Display[1]" value="lname"/></td>
			<td><input class="req_box" type="checkbox" name="Req[1]" value="lnameR"/></td>
		</tr>

ETC ETC

 

Then the way I first came up with it was to use POST and on the following page have

 

if(isset($_POST['submit'])) {
if(empty($_POST['Display']))
{
echo("You Did Not Select Anything To Display.");
}
else
{
         //if the name of field is in the array $arr
		if(in_array("fname",$arr)){
      //display the input field
		echo '<li>$fnametitle<input type="text" class="text" value="" name="First Name" /> </li>';
		}
		if(in_array("lname",$arr)){
		echo '<li>Last Name:<input type="text" class="text" value="" name="Last Name"/> </li>';
		}

ETC ETC

 

The problem I have come across is that now I can not put POST/GET method in the input fields on the second form. I need a way to be able to collect the information on the second form as well. Is there a way to echo HTML forms as well as PHP?

Link to comment
https://forums.phpfreaks.com/topic/202395-forms-form-and-more-forms/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.