Ok the first chunk of code is the upload form
this is called upload.php
This is where i load the form up and ask the user to choose the file to be uploaded
<?
session_start();
include 'header.inc';
include 'form_func.php';
?>
<title>BAM - Property Service - Upload Image</title>
<table cellpadding="0" cellspacing="0" width="800" border="0">
<tr>
<td bgcolor="#6273BE"> </td>
<td bgcolor="#EEEEEE"> </td>
</tr>
<tr>
<td width="15%" align="center" valign="top" bgcolor="#6273BE">
<table width="100%" cellpadding="4" cellspacing="4" border="0">
<tr>
<td align="center" class="leftHeader">
upload image
</td>
</tr>
<tr>
<td align="right" class="leftBody">
back to agents page
</td>
</tr>
<tr>
<td align="center" class="leftBody">
<br><br><br><br><br><br><br><br><br><br><br><br>
</td>
</tr>
<tr>
<td align="center" class="leftBody">
<img src="Images/BAMBottom.gif" border="0" height="86" width="113">
</td>
</tr>
</table>
</td>
<td width="85%" align="center" valign="top" bgcolor="#EEEEEE">
<table width="100%" cellpadding="4" cellspacing="4">
<tr>
<td colspan="2" class="Title">Agent - Upload Company Logo</td>
</tr>
<? check_valid_agent(); ?>
<tr>
<td colspan="2" class="Body">Upload your companies logo onto BAMs database, so whenever a user
searches for a property your logo will be placed next to each of your
properties</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td class=body>Current Company logo is:</td>
<? echo "</tr>" . getagentlogo($valid_agent) ."</tr>"; ?>
</tr>
<form enctype="multipart/form-data" action="uploadimage.php" method="post">
<tr>
<td width="25%" align="right" class="Form">Upload New Image:</td>
<td width="75%" align="left"><input name="userfile" type="file"></td>
</tr>
<tr>
<td width="25%" align="left"><input type="hidden" name="MAX_FILE_SIZE" value="10000000"></td>
<td width="75%" align="left"><input type="submit" value="Send File"></td>
</form>
</tr>
</table>
</td>
</tr>
</table>
<?
include 'footer.inc';
?>
This next bit of code is the confirmation / preview of the file that has been uploaded. The problem lies when previewing the img in the <img ....> tag because it concatinates the filename
I hope this helps.. thanks once again for ur help
<?
session_start();
include 'header.inc';
include 'form_func.php'
?>
<title>BAM - Property Service - Uploading Image.....</title>
<table cellpadding="0" cellspacing="0" width="800" border="0">
<tr>
<td bgcolor="#6273BE"> </td>
<td bgcolor="#EEEEEE"> </td>
</tr>
<tr>
<td width="15%" align="center" valign="top" bgcolor="#6273BE">
<table width="100%" cellpadding="4" cellspacing="4" border="0">
<tr>
<td align="center" class="leftHeader">
uploading image
</td>
</tr>
<tr>
<td align="right" class="leftBody">
<a href="agent.php" class="leftbody">back to agents page</a>
</td>
</tr>
<tr>
<td align="right" class="leftBody">
<a href="upload.php" class="leftbody">upload image</a>
</td>
</tr>
<tr>
<td align="center" class="leftBody">
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</td>
</tr>
<tr>
<td align="center" class="leftBody">
<img src="Images/BAMBottom.gif" border="0" height="86" width="113">
</td>
</tr>
</table>
</td>
<td width="85%" align="center" valign="top" bgcolor="#EEEEEE">
<table width="100%" cellpadding="4" cellspacing="4">
<tr>
<td colspan="2" class="Title">Uploading ....</td>
</tr>
<? check_valid_agent(); ?>
<tr>
<td colspan="2" class="subtitle"><strong>Uploading file ....</strong></td>
</tr>
<!--<tr>
<td colspan="2"> </td>
</tr> -->
<tr>
<?
if ($userfile=="none"

{
echo "<td class=body>Problem: no file uploaded</td>";
exit;
}
if ($userfile_size==0)
{
echo "<td class=body>Problem: uploaded file is zero length</td>";
exit;
}
$upfile = "$DOCUMENT_ROOT/php/agents/$valid_agent/" .$userfile_name;
if (!copy($userfile, $upfile))
{
echo "<td class=body>Problem: Could not move file into directory</td>";
exit;
}
echo "<td class=body>File uploaded successfully</td>";
$fp = fopen($upfile, "r"

;
$contents = fread ($fp, filesize ($upfile));
fclose ($fp);
$contents = strip_tags($contents);
$fp = fopen($upfile, "r"

;
fwrite($fp, $contents);
fclose($fp);
//$filecontents = fread($fp, filesize($userfile));
echo "<tr><td class=form>Preview of uploaded file contents:</td></tr>";
$image = $userfile_name;
echo "<tr><td colspan=2><img src=php/agents/$valid_agent/$userfile_name height=200 width=200> </td></tr>";
//add this to agents database
$url = "$DOCUMENT_ROOT/php/agents/$valid_agent/$image";
//echo $url;
$conn=db_connect();
$result = mysql_query("UPDATE estateagent SET EstateLogo=\"$url\" WHERE Email=\"$valid_agent\""

;
?>
</tr>
</table>
</td>
</tr>
</table>
<?
include 'footer.inc';
?>
THANKS AGAIN FOR UR HELP IT IS MUCH APPRECIATED
SANJ