LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 326 users online 221741 members 380 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Memberlist | Dictionary | News | FAQ
Member Spotlight
Randomaster
Music: ťArmor For Sleep ťArmor For the Broken ...
Mood: Flirty
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
4 online / 15 MPM
Fresh Topics
  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic

Need Help - PHP
150 Points avaliable
Replies: 2Last Post Aug. 4, 2008 6:44am by Daveh
Welcome to LiveWire!
We're Stronger Together.
Join the Community
Single page for this topic Email Print Favorite
( Daveh )


Wealthy Hobo

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 | Days Active: 306
Join to learn more about Daveh England, United Kingdom | Male | Posts: 1,523 | Points: 4,627
LiveWire Humor
allsmiles


Enlightened One

Patron
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 | Days Active: 565
Join to learn more about allsmiles England, United Kingdom | Male | Posts: 8,804 | Points: 15,779
( Daveh )


Wealthy Hobo

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 | Days Active: 306
Join to learn more about Daveh England, United Kingdom | Male | Posts: 1,523 | Points: 4,627
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