Guys, need some help regarding this issue, i have a php file, which requests an invoice_no(invoice.php), then searches the database and returns the other value associated to it(eg,document_no,PO_no) to another php file(displaydata.php). Now the problem is, i wanna send the invoice_no not only to displaydata.php but to another file test.php.
This is what i did so far
invoice.php
<form method="post" name="form">
<h1>Enter your Invoice No.</h1>
<table>
<tr>
<td>Invoice No. :</td><td><input name="invoiceno" type="text" size"25"></input></td>
</tr>
</table>
<input type="submit" name="submit" value="Submit" onclick="form.action='displaydata.php';"></input>
<input type="submit" name="submit" value="Back" onclick="form.action='main_login.php';"></input>
</FORM>
displaydata.php
<?php
$host="localhost"; // Host name
$username=""; // Mysql username
$password=""; // Mysql password
$db_name="test"; // Database name
$tbl_name="testing"; // Table name
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die(mysql_error());
$invoiceno=$_POST['invoiceno'];
$sql="SELECT * FROM $tbl_name WHERE invoice_no = '$invoiceno'";
$result = mysql_query($sql);
$row = mysql_fetch_array($result) or die(mysql_error());
echo "Invoice: ".$row['invoice_no'] . "<br>";
echo "Document No.: ".$row['document_no']. "<br>";
echo "Number of Pallets: ".$row['no_pallets']. "<br>";
echo "Container No.: ".$row['container_no']. "<br>";
echo "Part No.: ".$row['part_no']. "<br>";
echo "Supplier Part No.: ".$row['spart_no']. "<br>";
echo "PO No.: ".$row['po_no']. "<br>";
echo "Status: ".$row['ship_status']. "<br>";
?>
thank u in advance