View Single Post
  #3 (permalink)  
Old 05-28-08, 08:14 AM
cyberfolli cyberfolli is offline
Newbie Coder
 
Join Date: Jan 2004
Posts: 93
Thanks: 8
Thanked 0 Times in 0 Posts
Code Post

This is the Form post link to display record for midification

Code:
<form action='admin_functions.php' method='post'> 
  <input name='modify_news' type='image' value='modify_news' src='modify.jpg' alt='Modify'>
<input type='hidden' name='newsIDnumber' value='$id'>
</form>
This is the modify page that I am using to display the fields

PHP Code:

function modify_news($newsIDnumber)
{    
beginHTML();
    print 
"<h4>Modify Entry</h4>";
        
//Retrieve the data from the _news that was selected to be modified or deleted
    
databaseConnect (&$conn, &$db_id);
    
$sql "select * from report where id = $newsIDnumber";
    
$result mysql_query($sql$conn);
    
$temp mysql_fetch_array($result);
    
        
//set the data to variables to be displayed as default values in their respective fields
            
        
$cfs $temp['cfs'];
        
$date_field $temp['date_field'];
        
$time_field $temp['time_field'];
        
$station $temp['station'];
        
$unit $temp['unit'];
        
$type $temp['type'];
        
$dispatch_time $temp['dispatch_time'];
        
$attendant $temp['attendant'];
        
$attendant_2 $temp['attendant_2'];
        
$attendant_3 $temp['attendant_3'];
        
$disposition $temp['disposition'];
        
$location $temp['location'];
        
$turnover $temp['turnover'];
        
$turned_in $temp['turned_in'];
            

        
//set up the page to display the values and have them modified if needed
    
print "<form action='admin_functions.php' enctype='multipart/form-data' method='post'>

<table width='750'  border='0' cellspacing='0' cellpadding='0'>
          <tr bgcolor='#CCCCCC'>
            <td width='152'>CFS</td>
            <td colspan='2'><input name='cfs' type='text' value='
$cfs' size='50'></td>
          </tr>
        
          <tr>
                  <td>Date Stamp</td>
                  <td width='251'>
                          <input name='date_field' type='text' id='date_field' value='
$date_field'  size='50'>
                  </td>
                   <td width='347'>&nbsp;</td>
        </tr>
          <tr bgcolor='#CCCCCC'>
            <td>Time Stamp</td>
            <td colspan='2'><input name='time_field' type='text' id='time_field' value='
$time_field'  size='50'></td>
          </tr>
          <tr>
            <td>Station</td>
            <td colspan='2'><input name='station' type='text' value='
$station'  size='50'></td>
          </tr>
          <tr bgcolor='#CCCCCC'>
            <td>Unit</td>
            <td colspan='2'><input name='unit' type='text' value='
$unit'  size='50'></td>
          </tr>
          <tr>
            <td>Type</td>
            <td colspan='2'><input name='type' type='text' id='type' value='
$type'  size='50'></td>
          </tr>
          <tr bgcolor='#CCCCCC'>
            <td>Dispatch Time</td>
            <td colspan='2'><input name='dispatch_time' type='text' id='dispatch_time' value='
$dispatch_time'  size='50'></td>
          </tr>
             <tr>
               <td>Attendant</td>
               <td colspan='2'><input name='attendant' type='text' value='
$attendant'  size='50'></td>
  </tr>
             <tr bgcolor='#CCCCCC'>
               <td>Attendant 2</td>
               <td colspan='2'><input name='attendant_2' type='text' value='
$attendant_2'  size='50'></td>
  </tr>
             <tr>
               <td>Attendant 3</td>
               <td colspan='2'><input name='attendant_3' type='text' id='attendant_3' value='
$attendant_3'  size='50'></td>
  </tr>
             <tr bgcolor='#CCCCCC'>
               <td>Disposition</td>
               <td colspan='2'><input name='disposition' type='text' id='disposition' value='
$disposition'  size='50'></td>
  </tr>
             <tr>
               <td>Location</td>
               <td colspan='2'><input name='location' type='text' id='location' value='
$location'  size='50'></td>
  </tr>     <tr>
               <td>Turnover</td>
               <td colspan='2'><input name='turnover' type='text' id='turnover' value='
$turnover'  size='50'></td>
  </tr>
       <tr>
               <td>Turned In</td>
               <td colspan='2'><input name='turned_in' type='text' id='location' value='
$turned_in'  size='50'></td>
  </tr>
  <tr>
            <td colspan='3'><input type='submit' name='doModify_news' value='Modify entry'>
              <input type='reset' value='Reset form'>
              <input type='hidden' name='newsIDnumber' value='
$newsIDnumber'>
              <input type='submit' value='Cancel' name='admin_newsDisplay'></td>
          </tr>
</table>
"
;
        
endHTML();


Last edited by Nico; 05-28-08 at 09:11 AM. Reason: Please use [php] wrappers when posting PHP code.
Reply With Quote