swieder Posted May 20, 2010 Share Posted May 20, 2010 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 More sharing options...
swieder Posted May 20, 2010 Author Share Posted May 20, 2010 Nobody knows any way to put PHP inside an echo tag or any possible work-arounds? Link to comment https://forums.phpfreaks.com/topic/202395-forms-form-and-more-forms/#findComment-1061246 Share on other sites More sharing options...
MatthewJ Posted May 20, 2010 Share Posted May 20, 2010 You may be missing some fundamental knowledge of php and/or going down the wrong road with your process if you're trying to have php code echo other php code. Either that, or you're not explaining the issue well. Link to comment https://forums.phpfreaks.com/topic/202395-forms-form-and-more-forms/#findComment-1061267 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.