Jump to content


Maintaining FORM data for consecutive entries

  • Please log in to reply
No replies to this topic

#1 modigy

  • Members
  • PipPipPip
  • Advanced Member
  • 30 posts
  • LocationMadrid, Spain

Posted 08 June 2006 - 08:50 PM

Hi...here's the problem:

I have a .php form 'addbook.php' that sends the textfield entries to another .php file 'submitbook.php' which opens a mysql connection and populates the database. Once the connection is made the data is placed in a table and 'submitbook.php' returns the client to the 'addbook.php' form if they would like to add another book.

My client sometimes enters 100s of entries under the same field names (mystery, drama, etc.). However, it returns them to 'addbook.php' and the form is blank.

How can return a variable back to the form so my client can maintain certain field entries for 'data-entry'?

Example: My client enters 100 books under the Subject: of 'Mystery'. For each book they have to re-type the Subject: 'Mystery'.

Here is a portion of my code:


**variables (top of page)**
global $title,$author,$subject,$month,$year,$subject,$publisher,$commentary;

$title = $author = $subject = $month = $year = $subject = $publisher = $commentary ="";

if ($isbn != "") {
include 'xmlparser_rc2.php';

**/variables (top of page)**

**form excerpt**

<td><span class="formcontent">Publisher:</span></td>
echo '<input name="publisher" type="text" id="publisher" size="50" value="'.$publisher.'" maxlength="100">';

**/form excerpt**



$tempdate = getdate( );
$entryDate = $tempdate['year'].'-'.$tempdate['mon'].'-'.$tempdate['mday'];

//Connect to database
if (!$database)
header('Location: errorbook?type=1.php');

$query="select * from jandj_jandj.books";
$i = 0;
while ($i<$copies) {
$submit="INSERT INTO jandj_jandj.books VALUES




if ($result)
// Data submitted. Returning to main book page.';
header('Location: addbook.php');

} else {
// header('Location: errorbook.php?type=2');
echo 'Error submitting book info!<br>
$submit = '.$submit;

<p> </p>


Please let me know what I can do here...I've been looking all over [img src=\"style_emoticons/[#EMO_DIR#]/huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /]

Thanks in advance...M
Code now, you'll get all the sleep you need when your Dead!!

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users