image display problem
| From: | umeed hayyat | Date: | Mon, 12 Sep 2005 08:46:53 +0000 |
| Subject: | image display problem | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-40253@lists.php.net to get a copy of this message | ||
Hi
I have a form where user can add a category or edit some existing
category.
It is perfectly running on localhost but when i uploaded it to an ftp
server (that was Linux based), it isnt displaying any images when i add
any image through image uploading script, neither can i view any image
on edit_category page, nor i can view when i change image while i edit
any category.
/////////////////////category_upload_image.php/////////////////////
<form name="sqlform" action="categories_edit_process.php"
method="post"
enctype="multipart/form-data">
<table border="0" width="100%" cellspacing="0"
cellpadding="2">
<tr>
<td>Category Name: <input type="text" name="categories_name"
value="<?= $rows['cat_name']; ?>"></td>
</tr>
<tr>
<td>Category Image:
<img src="../images/categories/<?= $rows['cat_image']; ?>"
name="catimage" width="120" height="150"><br>
<input type="hidden" name="categories_image" value="<?=
$rows['cat_images']; ?>">
</td>
<td
><a href="#"
onClick="MM_openBrWindow('category_upload_image.php','cateimg','width=400,height=300')">
Change image</a></td>
</tr>
<tr>
</form>
</body>
</html>
/////////////////////////////////////////////////////////////////////////
////////////////image_upload.php//////////////////////////////////
<html>
<head></head>
<body>
<form action="upload_image.php" method="post"
enctype="multipart/form-data" name="form1">
<table width="100%" border="0" align="center"
cellpadding="3"
cellspacing="3" >
<tr>
<td width="362" height="102" align="center"
valign="middle">
Please upload your image: <input name="file1" type="file" >
</td>
</tr>
<tr>
<td align="center" valign="top" >
<input name="Upload" type="submit" value="Upload" >
</td>
</tr>
<tr>
<td align="center" valign="top" >
<?php
if(isset($Upload))
{
$uploaddir = '../images/categories/';
$uploadfile = $uploaddir . $_FILES['file1']['name'];
$name = $HTTP_POST_FILES['file1']['name'];
if ($file1_name != "")
{ if (move_uploaded_file($_FILES['file1']['tmp_name'], $uploadfile))
{
print "<p class='highlight'>File is valid, and was successfully
uploaded.</p> ";
}
else
{
echo "<p class='highlight'>Could Not Copy file<br></p>";
}
}
else
{
echo "<p class='highlight'>No file selected<br></p>";
}
echo "<FORM>
<INPUT type='button' name='b1' value='Close Window'
onClick='closewin1();'>
</FORM>";
}
?>
</tr>
</table>
</form></td>
</tr>
</table>
<script language="JavaScript">
function closewin1()
{
var nam;
nam= "<?php echo $name; ?>";
window.opener.document.sqlform.catimage.src="../images/categories/"+nam;
window.opener.document.sqlform.categories_image.value=nam;
window.close();
}
</script>
</body>
</html>
////////////////////////////////////////////////////////////////////////////
Any ideas?????
Regards
Umeed
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com