0

I have tried to get this working for a couple hours now, i think its related to the fact that i have a $_GET['ID']; on the first script but im not sure:

Script 1 (FORM):

<?php
 require_once('db_access.php');
 $editID = $_GET['id'];
    $query = mysql_query("SELECT * from routes where id = '".$editID."'");
    $row = mysql_fetch_assoc($query);
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Form Edit Data</title>
</head>
<body>
<table border=1>
  <tr>
    <td align=center>Route Edit Data</td>
  </tr>
  <tr>
    <td>
      <table>
      <form method="post" action="complete_edit.php">
        <tr>        
          <td>ID #</td>
          <td>
            <input type="hidden" name="formid" value="<?php echo $row['id'] ?>">
          </td>
        </tr>
        <tr>
          <td>Route Name</td>
          <td>
            <input type="text" name="route_title" size="40" 
          value="<?php echo $row['route_title']?>">
          </td>
        </tr>
        <tr>
          <td>Total Price</td>
          <td>
            <input type="text" name="total_price" size="40" 
          value="<?php echo $row['total_price']?>">
          </td>
        </tr>
        <tr>
          <td>Down Payment</td>
          <td>
            <input type="text" name="down_payment" size="40" 
          value="<?php echo $row['down_payment']?>">
          </td>
        </tr>
        <tr>
          <td>Weekly Net</td>
          <td>
            <input type="text" name="weekly_net" size="40" 
          value="<?php echo $row['weekly_net']?>">
          </td>
        </tr>
        <tr>
          <td>Location</td>
          <td>
            <input type="text" name="location" size="40" 
          value="<?php echo $row['location']?>">
          </td>
        </tr>
        <tr>
          <td>Remarks</td>
          <td>
            <input type="text" name="remarks" size="40" 
          value="<?php echo $row['remarks']?>">
          </td>
        </tr>
        <tr>
          <td align="right">
            <input type="submit" 
          name="submit value" value="Edit">
          </td>
        </tr>
      </form>
      </table>
    </td>
  </tr>
</table>
</body>
</html>

SCRIPT 2(PROCESSING):

<?php
  $id = $_POSt['formid'];
  $editroute = $_POST['route_title'];
     $editprice = $_POST['total_price'];
     $editdownpay = $_POST['down_payment'];
     $editweeklynet = $_POST['weekly_net'];
     $editlocation = $_POST['location'];
     $editremarks = $_POST['remarks'];

     $query = "UPDATE routes SET id = '$id', route_title = '$editroute', total_price = '$editprice', down_payment = '$editdownpay', weekly_net = '$editweeklynet', location = '$editlocation', remarks = '$editremarks' WHERE id = '$id'";
     header('Location:index.php');
?>      

The first lot of code is where my form is placed and the second is where the processing happens Thanks for your help people :) Alex

2 Answers2

1
$id = $_POSt['formid'];

$_POSt is not $_POST

0

Im so silly after reading the comments to the question here i realised that i had no mysql_query string :) Thanks guys for giving me my mind haha :) Alex