<?php
$SQL = "SELECT * from LINKS WHERE ID = '$_GET[id]'"; $result = @mysql_query( $SQL ); $row = @mysql_fetch_array( $result );
if (empty($row[ID]) || $_GET['clone'] == 1) $qt = insert; else $qt = update;
?> 
<FORM METHOD="post" ACTION="../library/query.php?addphoto=1" name="FieldName" ENCTYPE="multipart/form-data" >
<INPUT TYPE="hidden" NAME="controller" VALUE="LINKS~<?php echo $qt; ?>~showlinks~<?php if ($_GET['clone'] != 1) echo $_GET[id]; ?>">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr> 
<td class="td3" colspan="2"> <b> Add Link</b></td>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr> 
<td class="td4"  width="50%"> Link Name</td>
<td class="td4"  width="50%"> 
<input type="text" name="TITLE" size="40"  class="textarea100" value="<?php echo $row[TITLE]; ?>">
</td>
</tr>
<tr> 
<td class="td4"  width="50%"> Link URL</td>
<td class="td4"  width="50%"> 
<input type="text" name="URL" size="40"  class="textarea100" value="<?php echo $row[URL]; ?>">
</td>
</tr>
<tr> 
<td class="td4"  width="50%"> Link Sort Position Value (left to right &quot;0&quot; being far left, 1 being to the right of it, 2, 3, 4 etc)</td>
<td class="td4"  width="50%"> 
<input type="text" name="SP" size="40" class="textarea100" value="<?php echo $row[SP]; ?>">
</td>
</tr>
<?php if ($row[ID] != $nil) { ?>
<?php IF ($row[IMAGENAME] != $NIL) { 

 $filename = "$svr_rootscript/product_images/$row[IMAGENAME].jpg";
        if (file_exists($filename)) $ext = jpg;

 $filename = "$svr_rootscript/product_images/$row[IMAGENAME].png";
        if (file_exists($filename)) $ext = png;
?>
<?php } ?>
<?PHP } ?>
<tr> 
<td class="td4" width="50%">&nbsp;</td>
<td class="td4" width="50%"> 
<input type="hidden" name="hiddenField">
<input type="submit" name="Submit" value="Submit" />
</td>
</tr>
</table>
</FORM>
