texmansru47 Posted May 23, 2008 Share Posted May 23, 2008 How do everyone, I have a question... I have a theory for my application but I'm very new to the art of php development... well development in general. What I would like to do is create a php form where I can type in a batch number (lets say this is a job that contains multiple pieces of a certain product)... by do that and I click the SUBMIT button data will populate the top half of the form (something like a SELECT * FROM mytable WHERE batchnum = '$_POST[batchnum]' - assuming on the main form there is a call for this option) with the data for that batch job. The second half of the screen is where the user can scan in the products that are to be in tha batch number (lets say they are collecting the serial number, color, model information). Here is where I cannot figure out what to do. First how can I run the initial search and populate and the main form stays in place (not routing me to the php page) and secondly is it possible in that same main form (php coding) as each product is collected into the system, they popluate that same screen? For me this would be the simpliest process, but for the life of me I cannot figure out if this is possible or not. Any ideas? Texman Link to comment https://forums.phpfreaks.com/topic/107008-multiple-data-entry-on-one-screen/ Share on other sites More sharing options...
BlueSkyIS Posted May 23, 2008 Share Posted May 23, 2008 i'm not real clear on what you're asking. but the gist i get is that you feel that you need to have HTML and PHP in separate files. not necessary. i would have the form and the displayed data in the same file, sort of like: <?php if ($_SERVER['REQUEST_METHOD'] == "POST") { // someone submitted the form // Do stuff with the form data... } ?> <HTML> <HEAD> <TITLE>Test Page</TITLE> </HEAD> <BODY> <?php // List all records: $sql = "SELECT * FROM some_table ORDER BY some_criteria"; $result = mysql_query($sql) or die(mysql_error()); while ($a_row = mysql_fetch_assoc($result)) { // echo data for each row... } ?> <FORM METHOD='POST' ACTION='<?php echo $_SERVER['PHP_SELF']; ?>'> <INPUT TYPE='text' NAME='field1'> <INPUT TYPE='submit'> </FORM> </BODY> </HTML> Link to comment https://forums.phpfreaks.com/topic/107008-multiple-data-entry-on-one-screen/#findComment-548556 Share on other sites More sharing options...
texmansru47 Posted May 24, 2008 Author Share Posted May 24, 2008 WOW! I did not realize you can do that... all the php primers out on the net that I can find all indicate to have two files. That will be Huge if I can do that. Would that apply for part 2(as the user enters the data for the batch it can popluate on the same screen... maybe in a table type structure)??? In VB with .ASP I remember our development team did this very thing for another product line... Now that I have my own company and perfer to try this with Linux, but I don't have the proper level of understanding yet, but I'm trying to pick it up fast. Link to comment https://forums.phpfreaks.com/topic/107008-multiple-data-entry-on-one-screen/#findComment-548672 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.