|
-
Dec 15th, 2006, 05:20 PM
#1
Thread Starter
Frenzied Member
format and search
For some reason i can not get my search box's to line up..
Also, is there an easier way to make this? I have multiple fields i want to search. I was thinking maybe make a drop down box, and then just have 1 field where you enter text, then a drop down box with the different querys.
I wanted to see if the results can be displayed on the same page, instead of posting it to a new page.
Here is my layout:
Here is my code.
Thanks again.
PHP Code:
<?php
//adding header.php
$page_title = "Enter New Model Information";
include('../php/header.php');
?>
<?php
//connection to database
include('../db_conn/mysql_conn.php');
?>
<table>
<tr>
<td rowspan="2">
<fieldset>
<table>
<tr>
<td><form action="Search.php?pasc_id=<?php $pasc_id?>" method="post"><input type="submit" name="submit" value="Search" align="right"/> <input type="text" name="pasc_id" size="20" maxlenght="20" /></td>
<td valign="top"><font size="-1">Pasc ID</font></form></td></tr>
<tr>
<td><form action="Search.php" method="post"><input type="submit" name="submit" value="Search" align="right"/> <input type="text" name="return_po" size="20" maxlenght="20" /></form></td>
<td valign="top"><font size="-1">PO Number</font></td></tr>
<tr>
<td><form action="Search.php" method="post"><input type="submit" name="submit" value="Search" align="right"/> <input type="text" name="part_number" size="20" maxlenght="20" /></form></td>
<td valign="top"><font size="-1">Part Number</font></td></tr>
<tr>
<td><form action="Search.php" method="post"><input type="submit" name="submit" value="Search" align="right"/> <input type="text" name="dss_what_was_repaired" size="20" maxlenght="20" /></form></td>
<td valign="top"><font size="-1">What was repaired</font></td></tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
</fieldset>
</td>
</tr>
<tr>
</tr>
</table>
<?php
if($_SERVER['REQUEST_METHOD'] == "POST"){
//do your error checking now
//--> check if each variable you want to use exists using isset(), and if it doesn't, make an error
$errors = array(); //the error variable
$pasc_id = trim($_POST['pasc_id']);
//now, we won't do ANYTHING unless there are no errors
if(count($errors) == 0){
//submit your stuff
mysql_query("UPDATE dss_returns SET part_number='$partnumber',return_po='$return_po',date_entered='$date_entered',part_notes='$part_notes',part_returned='$part_returned' WHERE pasc_id='$pasc_id'") or die(mysql_error());
echo 'Your information has been successfully updated. Refreshing page' . ' <img src="../images/working.gif">';
echo '<meta HTTP-EQUIV="refresh" content=2; url="Update.php">';
}else{
//there were errors, spit them all out
echo 'The following fields were left blank:' . "\n\n";
foreach($error as $errors){
echo $error . "\n";
}
echo "\n" . 'Please fill out the form again';
}
}
?>
<?php
//adding footer.php
include('../php/footer.php');
?>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|