Saving technique

Greetings!

I have here three forms, pages A.php, B.php and C.php

A.php


foreach ($Acode as $code) {
	echo $code, $Titles, $Subs ,$Pubs, $Pubnames ,$Bnums.'<br/>';
	mysql_query("INSERT INTO tbl_bdetail (bdetail_Title, bdetail_Subject, bdetail_Pubname, bdetail_Pubplace, bdetail_Classnum, author_Id)
        		 VALUES ('$Titles', '$Subs', '$Pubs', '$Pubnames', '$Bnums', '$code')") or die (mysql_error());
	}
	
	for($i = 0; $i < count($Acode); $i++) {
	$Acod = $Acode[$i];
	$Fnam = $Fname[$i];
	$Lnam = $Lname[$i];
	$Mnam = $Mname[$i];

	$Title = $Titles[$i];			
	$Sub = $Subs[$i];			
	$Pub = $Pubs[$i];			
	$Pubname = $Pubnames[$i];			
	$Bnum = $Bnums[$i];

	echo "$Acod $Fnam $Lnam $Mnam <br/>";
	mysql_query("INSERT INTO tbl_author (author_Id, author_Fname, author_Lname, author_Mname)
	     		 VALUES ('$Acod', '$Fnam', '$Lnam', '$Mnam' )") or die (mysql_error());
	}

I manage to save the data from A.php, what troubles me is that I’m confused on how to save the data from B.php, which has an array of accnum, copy, locate, funds, stat and remarks, and a string value of copyright, pages, book amount, and supplier.

My problem is I don’t know how to save it effectively. I need to save the data from B.php which include the id [autoincrement] value of tbl_bdetail.

To make it clear, I want to save, tbl_bdetail.id , accnum, copy, locate, funds, stat, remarks, copyright, pages, book amount, and supplier in tbl_baccquisition.

Thank you in advance.

I’m having trouble understanding what you’re asking, posting more code would be helpful (eg. b.php).

From what I understand, you have some variables in one file you would like to use in another?

Would this help?

include("B.php");

If the variables are used for many pages you could put them all in a separate file and reference them via the code above.