angelstar
12-31-2007, 09:13 PM
hi,
i created a form in which you will put all the data, my prblem is, I want to save it in the database and at the same time it will appear on another page with a table form, I don't know if i used the right code.. please check my code below...
thanks :confused:
====this is the form code===
<form method="get" action ="#.php">
<table border=0 class="sam" align=center>
<td class="td1"><br><br>
<br>Users Information
<td class="td1"><td class="td1"><td class="td1">
<tr><td>
Department:<td>
<select name="department">
<option value="Select...">Select...</option>
<option value="Cebu">Cebu</option>
<option value="Davao">Davao</option>
<option value="Executive">Executive</option>
<option value="Finance">Finance</option>
<option value="Marketing">Marketing</option>
<option value="MIS">MIS</option>
<option value="Quality and Customer Care">Quality and Customer Care</option>
<option value="Sales">Sales</option>
<option value="Service">Service</option>
<option value="Supply Chain">Supply Chain</option></select>
</td>
<td>
 Date:<td> <input type="text" name="dept" size="10">
</td>
<tr>
<td>
User Name:<td><input type="text" name="user" size="27">
</td>
<tr>
<td class="td1">
<br>
Issued Equipment
<td class="td1"><td class="td1"><td class="td1">
</td>
<tr>
<td>
Form:<td><select name="form">
<option value="Select...">Select...</option>
<option value="Desktop">Desktop</option>
<option value="Laptop">Laptop</option>
<option value="Notebook">Notebook</option>
</select>
</td>
===this is the save code===
<?php
header("Expires: Thu, 17 May 2001 10:17:17 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s"). " GMT");
header("cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
session_start();
$_SESSION['mainFrameurl']=$_SERVER["REQUEST_URI"];
include_once("images/connect.php");
$sserial = $_REQUEST['serial'];
if($sserial)
{
$sql="SELECT*FROM tblmaster WHERE serial =".$sserial;
$result = mysql_query($sql);
$sLoaddepartment = mysql_result($result,$i,"department");
$sLoaduserName = mysql_result($result,$i,"userName");
$sLoadissued = mysql_result($result,$i,"issued");
$sLoadform = mysql_result($result,$i,"form");
$sLoadbrand = mysql_result($result,$i,"brand");
$sLoadmodel = mysql_result($result,$i,"model");
$sLoadserial = mysql_result($result,$i,"serial");
$sLoaddatepurchased = mysql_result($result,$i,"datepurchased");
$sLoadprocessor = mysql_result($result,$i,"processor");
$sLoadsystem = mysql_result($result,$i,"system");
$sLoadusb = mysql_result($result,$i,"usb");
$sLoadmemory = mysql_result($result,$i,"memory");
$sLoadharddisk = mysql_result($result,$i,"harddisk");
$sLoadphone = mysql_result($result,$i,"phone");
$sLoadcost = mysql_result($result,$i,"cost");
$sLoadremarks = mysql_result($result,$i,"remarks");
}
?>
====and this is the table code where I want those data to appear====
<table border=1>
<th class="td1">Department</th>
<th class="td1">User Name</td></th>
<th class="td1">Form</td></th>
<th class="td1">Type/Model</td></th>
<th class="td1">Brand</td></th>
<th class="td1">Date Purchased</td></th>
<!---the primary key-->
<th class="td1">Serial Number</td></th>
<th class="td1">Processor</td></th>
<th class="td1">Operating System</td></th>
<th class="td1">Memory</td></th>
<th class="td1">USB Flash Drive</td></th>
<th class="td1">Harddisk Capacity</td></th>
<th class="td1">Telephone Model</td></th>
<th class="td1">Acquisition Cost</td></th>
<tr>
<td name="department"></td>
<td name="user"></td>
<td name="form"></td>
<td name="model"></td>
<td name="brand"></td>
<td name="purchase"></td>
<td name="serial"></td>
i created a form in which you will put all the data, my prblem is, I want to save it in the database and at the same time it will appear on another page with a table form, I don't know if i used the right code.. please check my code below...
thanks :confused:
====this is the form code===
<form method="get" action ="#.php">
<table border=0 class="sam" align=center>
<td class="td1"><br><br>
<br>Users Information
<td class="td1"><td class="td1"><td class="td1">
<tr><td>
Department:<td>
<select name="department">
<option value="Select...">Select...</option>
<option value="Cebu">Cebu</option>
<option value="Davao">Davao</option>
<option value="Executive">Executive</option>
<option value="Finance">Finance</option>
<option value="Marketing">Marketing</option>
<option value="MIS">MIS</option>
<option value="Quality and Customer Care">Quality and Customer Care</option>
<option value="Sales">Sales</option>
<option value="Service">Service</option>
<option value="Supply Chain">Supply Chain</option></select>
</td>
<td>
 Date:<td> <input type="text" name="dept" size="10">
</td>
<tr>
<td>
User Name:<td><input type="text" name="user" size="27">
</td>
<tr>
<td class="td1">
<br>
Issued Equipment
<td class="td1"><td class="td1"><td class="td1">
</td>
<tr>
<td>
Form:<td><select name="form">
<option value="Select...">Select...</option>
<option value="Desktop">Desktop</option>
<option value="Laptop">Laptop</option>
<option value="Notebook">Notebook</option>
</select>
</td>
===this is the save code===
<?php
header("Expires: Thu, 17 May 2001 10:17:17 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s"). " GMT");
header("cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
session_start();
$_SESSION['mainFrameurl']=$_SERVER["REQUEST_URI"];
include_once("images/connect.php");
$sserial = $_REQUEST['serial'];
if($sserial)
{
$sql="SELECT*FROM tblmaster WHERE serial =".$sserial;
$result = mysql_query($sql);
$sLoaddepartment = mysql_result($result,$i,"department");
$sLoaduserName = mysql_result($result,$i,"userName");
$sLoadissued = mysql_result($result,$i,"issued");
$sLoadform = mysql_result($result,$i,"form");
$sLoadbrand = mysql_result($result,$i,"brand");
$sLoadmodel = mysql_result($result,$i,"model");
$sLoadserial = mysql_result($result,$i,"serial");
$sLoaddatepurchased = mysql_result($result,$i,"datepurchased");
$sLoadprocessor = mysql_result($result,$i,"processor");
$sLoadsystem = mysql_result($result,$i,"system");
$sLoadusb = mysql_result($result,$i,"usb");
$sLoadmemory = mysql_result($result,$i,"memory");
$sLoadharddisk = mysql_result($result,$i,"harddisk");
$sLoadphone = mysql_result($result,$i,"phone");
$sLoadcost = mysql_result($result,$i,"cost");
$sLoadremarks = mysql_result($result,$i,"remarks");
}
?>
====and this is the table code where I want those data to appear====
<table border=1>
<th class="td1">Department</th>
<th class="td1">User Name</td></th>
<th class="td1">Form</td></th>
<th class="td1">Type/Model</td></th>
<th class="td1">Brand</td></th>
<th class="td1">Date Purchased</td></th>
<!---the primary key-->
<th class="td1">Serial Number</td></th>
<th class="td1">Processor</td></th>
<th class="td1">Operating System</td></th>
<th class="td1">Memory</td></th>
<th class="td1">USB Flash Drive</td></th>
<th class="td1">Harddisk Capacity</td></th>
<th class="td1">Telephone Model</td></th>
<th class="td1">Acquisition Cost</td></th>
<tr>
<td name="department"></td>
<td name="user"></td>
<td name="form"></td>
<td name="model"></td>
<td name="brand"></td>
<td name="purchase"></td>
<td name="serial"></td>