Ok i'm missing somthing here, i've done file uplaod a million times but i cant get this one working.....
my upload script is below.
I'm trying to store the path the file is uploaded to (So and replace the existing path in the DB)PHP Code:<?php
$uploaddir = "http://lindowltc.org.uk/news/";
if(is_uploaded_file($_FILES['file']['tmp_name']))
{
move_uploaded_file($_FILES['file']['tmp_name'],$uploaddir.'/'.$_FILES['file']['name']);
}
$path = "http://'site'.org.uk/news/" . $_FILES['file']['name'];
$msg = "Image Uploaded";
$host="localhost";
$user="a";
$password="b";
$database="c";
$connection = mysql_connect($host,$user,$password);
$db = mysql_select_db($database,$connection);
$query =("REPLACE INTO tblNews(id,news) VALUES (1,'$path')");
header('Location: http://'site'/Admin/news/upload.php?path='.$path."&msg=".$msg);
?>
That the actual upload form,PHP Code:<form enctype="multipart/form-data" action="doUpload.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="500000">
<strong>Upload An Image</strong> -<input type="file" name="file" size="60">
<input type="submit" name="upload" value ="Upload News">
</form>
Am i missing somthing simple here?
the errors are,
Warning: move_uploaded_file(http://path/news//50.jpg[/url]): failed to open stream: HTTP wrapper does not support writeable connections. in /home/lindowltcuk/public_html/Admin/letter/doUpload.php on line 6
Warning: move_uploaded_file(): Unable to move '/tmp/phpnRLz5L' to 'http://path/news//50.jpg' in /home/path/public_html/Admin/letter/doUpload.php on line 6
http://path/news/50.jpg
Warning: Cannot modify header information - headers already sent by (output started at /home/path/public_html/Admin/letter/doUpload.php:6) in /home/path/public_html/Admin/letter/doUpload.php on line 23




Reply With Quote