LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 327 users online 184925 members 402 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Video | Dictionary | News | FAQ
You have 1 new message.
Emergency Help
Until you sign up you can't do much. Yes, it's free.

Sign Up Now
Membername:
Password:
Already have an account?
Invite Friends
Active Members
Groups
Contests
Moderators
2 online / 29 MPM
Fresh Topics
  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic

Need Help - PHP
150 Points avaliable
Replies: 2Last Post Aug. 4 6:44am by daveh
Single page for this topic Email Print Favorite
( daveh )


Professional

Patron
Reply
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:
<?php

$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


6:34 am on Aug. 4, 2008 | Joined Mar. 2008 | 130 Days Active
Join to learn more about daveh England, United Kingdom | Straight Male | 626 Posts | 2259 Points
allsmiles


Soothsayer

Ad Free
Reply
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']);

Post edited at 6:40 am on Aug. 4, 2008 by allsmiles

-------
When they leave me, they're all smiles.
When they leave you, they're in tears.


6:39 am on Aug. 4, 2008 | Joined Aug. 2007 | 360 Days Active
Join to learn more about allsmiles England, United Kingdom | Male | 6393 Posts | 12315 Points
( daveh )


Professional

Patron
Reply
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.  


6:44 am on Aug. 4, 2008 | Joined Mar. 2008 | 130 Days Active
Join to learn more about daveh England, United Kingdom | Straight Male | 626 Posts | 2259 Points
Single page for this topic Email Print Favorite

Quick Reply

You are signed in as our guest.

Looking for something else?
 

  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic