What I have is a page where people can upload photos of their properties -
what I need to do is check for any spaces in filename if there are any.
here is the code I have that handles the image values sent over from the form.
Code: Select all
if ($HTTP_POST_FILES['img1']['name']['size']>$max_size)
{
echo "The file for image 1 is too big - Please go back to the Homeowner Admin and edit your listing <a href=\"index.php\" > Click Here.</a><br>\n"; exit;
}
else
{
$imgone=$HTTP_POST_FILES['img1']['name'];
}
Code: Select all
$imgone = str_replace ( ' ', '_', $imgone );
if i could get the file uploading to have a '_' instead of space and the filename stored in mysql the same my problem would be solved.
can anyone point me in the right direction on how to fit this into my code
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: