UPDATE via text box's

Discussion in 'PHP' started by St-evo, Jun 12, 2008.

  1. #1
    This may sound easy, but I have no idea where to start (apart from query), I have been approached by work to actually rebuild a 8 year old php system, I have winged it so far and nothing has gone wrong, but I have now hit a major wall.

    The this moment in time Im using

    <td nowrap bgcolor="#CCCCCC"><div align="center"><a href="editchem.php?edit=<?php echo $row_loc['LocID'] ?>"><img src="icons/but/pencil.png" width="17" height="17" border="0"></a></div></td>
    PHP:
    To link to a new page, I have never done anything like this before as now I need to basically bring up the new page (editchem.php) list the selected item in boxes (editable) and then allow the user to edit it.

    Can anyone point me in the right direction of what to do? lol. Vague I know

    <body>
    <p>
      <?php
    	require_once('../Connections/chem.php');
    	
    $location = $_GET['location'];
    $locID = $_GET['locID'];
    $Description = $_GET['Description'];
    
    	mysql_select_db($database_chem, $chem);
    	$query_chm = "SELECT * FROM loc";
    	$chm = mysql_query($query_chm, $chem) or die(mysql_error());
    	
    ?>
    <form name="form1" method="post" action="">
    <table align="center">
    <tr>
    	<td><label for="location"><b>Location:</b></label></td>
    	<td>
    	  <input type="text" name="location" value="<?php echo $rw_chem['location'] ?>">
    	</td>
    </tr>
    <tr>
    	<td colspan="2"><input type="submit" name="Submit" value="Submit"><input type="reset" name="Submit2" value="Reset"></td>
    </tr>
    </table>
    </form>
    <p>
    </body>
    PHP:
     
    St-evo, Jun 12, 2008 IP
  2. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #2
    <td nowrap bgcolor="#CCCCCC"><div align="center">
    <form method="get" action="editchem.php">
    <input type="text" name="edit" value=<?=$row_loc['LocID']?>>
    <input type="submit" value="edit">
    </form>
     
    kmap, Jun 12, 2008 IP