modigy Posted June 10, 2006 Share Posted June 10, 2006 Hi All...I could really use some help...I have a php form that passes its variables on to another php form that load the information into a MySQL database. Once completed with this operation, the user is returned to the original form.I would like to be able to insert data from the prior entry back into the form for multiple entries.How can I do this??Exp: Textfields entered by client ([b]Input.php[/b]) sent as variables (to [b]AddInputMySQL.php[/b]) to be added to DB. I would like some of these variables sent back to Input.php to be reused for continuing 'dataentry'.Input.php ---> AddInputMySQL.php <connection to MySQL, variables entered into DB> ^ | <--------------------------< <-(specific variables from AddInputMySQL.php returned to Input.php)ANY and ALL help would be greatly appreciated!!Thank you,M Quote Link to comment https://forums.phpfreaks.com/topic/11657-form-auto-populate/ Share on other sites More sharing options...
joquius Posted June 10, 2006 Share Posted June 10, 2006 just have the input functions at the top of the page and add[code]<input type="text" name="field_name" <? if (isset ($_POST['php_form'])) echo "value=\"".$_POST['field_name']."\""; ?> />[/code] Quote Link to comment https://forums.phpfreaks.com/topic/11657-form-auto-populate/#findComment-44032 Share on other sites More sharing options...
modigy Posted June 12, 2006 Author Share Posted June 12, 2006 [!--quoteo(post=382253:date=Jun 10 2006, 06:14 PM:name=joquius)--][div class=\'quotetop\']QUOTE(joquius @ Jun 10 2006, 06:14 PM) [snapback]382253[/snapback][/div][div class=\'quotemain\'][!--quotec--]just have the input functions at the top of the page and add[code]<input type="text" name="field_name" <? if (isset ($_POST['php_form'])) echo "value=\"".$_POST['field_name']."\""; ?> />[/code][/quote]joquius,Thanks for your quick reply. A couple of questions I have:1. Which form do I need to put this in?2. You have written 'php_form' - which form would this be?Thanks for your help,M Quote Link to comment https://forums.phpfreaks.com/topic/11657-form-auto-populate/#findComment-44552 Share on other sites More sharing options...
.josh Posted June 12, 2006 Share Posted June 12, 2006 Input.php[code]<?php session_start();?><form method='post' action='AddInputMySQL.php'> blah: <input type='text' name='blah' value="<?= $_SESSION['blah'] ?>"> <input type='submit' value ='submit'></form>[/code]AddInputMySQL.php[code]<?php session_start(); $blah = $_POST['blah']; //update database script etc... $_SESSION['blah'] = $blah; header("Location: Input.php"); exit();?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/11657-form-auto-populate/#findComment-44613 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.