LiveWire Peer Support Network

Printable Version of Topic "Need Help - PHP"

- LiveWire Teen Forums & College Forums (http://www.golivewire.com)
-- (http://www.golivewire.com/forums/support-technical.html)
--- Programming & Application Development (http://www.golivewire.com/forums/forum-211-s-0.html)
---- Need Help - PHP (http://www.golivewire.com/forums/peer-yansstt-support-a.html)


-- Posted by DaveH at 6:34 am on Aug. 4, 2008

I will give 150 points to whoever can help me. I know it's not much but it's the most i can send.

Anyways

after looking to for a simple file upload script, which would HAD to simply echo the location of the uploaded file.

I have very no knowlage of PHP, but i have no choice but to give it a go myself since i really can't find one.

I've got the PHP script to upload the file, although i can't get it to echo the file location

here is my code

Code:
$location = "http://clan-adrenaline.com";;  // Location of upload.php
$target = "upload/";// Location files will be uploaded too
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
echo "This is the link to your song, this link should work in your profile ". echo "$location $target . basename( $_FILES['uploadedfile']['name']). ";
}
else {
echo "Sorry, there was a problem uploading your file.";
}
?>

This is the error i get

Code:
[04-Aug-2008 08:29:24] PHP Parse error:  syntax error, unexpected T_ECHO in /home/davhan/public_html/upload.php on line 10


-- Posted by allsmiles at 6:39 am on Aug. 4, 2008

Code:

echo "This is the link to your song, this link should work in your profile ". echo "$location $target . basename( $_FILES['uploadedfile']['name']). ";

should be

Code:
echo "This is the link to your song, this link should work in your profile ". $location . $target . basename( $_FILES['uploadedfile']['name']);


-- Posted by DaveH at 6:44 am on Aug. 4, 2008

Quote: from allsmiles at 6:39 am on Aug. 4, 2008


Code:

echo "This is the link to your song, this link should work in your profile ". echo "$location $target . basename( $_FILES['uploadedfile']['name']). ";

should be

Code:
echo "This is the link to your song, this link should work in your profile ". $location . $target . basename( $_FILES['uploadedfile']['name']);



I knew it would be something simple!

Thanks, i'll send the points right away.  


www.golivewire.com