Jump to content


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


Maintaining FORM data for consecutive entries

Recommended Posts

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

Share this post

Link to post
Share on other sites


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.