PHP question
|
View this Thread in Original format
DarkFall01 |
Hey guys,
I'm trying to upload files (mostly .doc, .txt, etc) to my FTP from a website.
So, I got these 2 .php files, here they are.
index.php
upload.php
When I run it it tells me this:
"; # Check whether file is uploaded successfully if($img1_name!=""){ @copy("$img1","$webServer$img1_name") or die("Couldn't copy the file"); } else{ die("No input file specified!$img1_name"); }
Success!
You sent : $img1_name, a $img1_size byte file with a mime type of $img1_type.
I don't know anything about php, what do I need to change to make this work? If the code is just completely retarded forget about it, lol.
Thanks:) |
|
|
icyhandofcrap |
you could try putting the code in <?php ?> tags, and the html out of them. :D
(yes, i know PHP) |
|
|
icyhandofcrap |
i have the strong suspicion your upload.php is completely retarded :P
thats not the way to access an uploaded file :D
i stopped programming PHP a while ago, and since then forget... and my webserver crashed and i reformatted my hard drive, so.. i have no examples of correct uploading code for you... oo and i gave my PHP book to someone else for a while
look at the manual on php.net |
|
|
igottaknow |
lol, that was some pretty funny code, maybe you should pick up a book (like icy suggested) and learn the basics of PHP before attempting to script something advanced. |
|
|
DarkFall01 |
quote: | Originally posted by igottaknow
lol, that was some pretty funny code, maybe you should pick up a book (like icy suggested) and learn the basics of PHP before attempting to script something advanced. |
Lol, actually a friend gave me that code.:happy2:
I don't know anything about php to be doing stuff like this
Thx anyway:p |
|
|
Boomer187 |
quote: | Originally posted by DarkFall01
Lol, actually a friend gave me that code.:happy2:
I don't know anything about php to be doing stuff like this
Thx anyway:p |
then replace "you" in that quote with "your friend"
or
< html>
< head>
< title> OMG
< /title>
< /head>
< body>
< ?
$dude = "your friend";
echo "lol, that was some pretty funny code, maybe $dude should pick up a book (like icy suggested) and learn the basics of PHP before attempting to script something advanced."
? >
< /body>
< /html> |
|
|
igottaknow |
quote: | Originally posted by DarkFall01
Lol, actually a friend gave me that code.:happy2: |
If a "friend" gave me that code to use he would no longer be my friend. :haha:
Boomer i like your "friend" script :D, but you would need to concatenate...
< ?
$dude = "your friend";
echo ("lol, that was some pretty funny code, maybe".
$dude . "should pick up a book (like icy suggested) and learn the basics of PHP before attempting to script something advanced.");
? > |
|
|
Boomer187 |
quote: | Originally posted by igottaknow
If a "friend" gave me that code to use he would no longer be my friend. :haha:
Boomer i like your "friend" script :D, but you would need to concatenate...
< ?
$dude = "your friend";
echo ("lol, that was some pretty funny code, maybe".
$dude . "should pick up a book (like icy suggested) and learn the basics of PHP before attempting to script something advanced.");
? > |
I actually tested mine out, since i am learning php and mysql myself, and it worked just fine :P.
So once you bring in all this technical jargon, Im out. |
|
|
DarkFall01 |
Bah, my roommate helped me out and then we realized my school doesnt allow file uploading with php :o
So, now I'm doing the same with perl, looks god so far :) |
|
|
Swamper |
Your school's server likely has php safe mode enabled for your account thus not allowing the uploading of files.
Paranoid bastards ;) |
|
|
DarkFall01 |
quote: | Originally posted by Swamper
Your school's server likely has php safe mode enabled for your account thus not allowing the uploading of files.
Paranoid bastards ;) |
Yeah, that's what they said, it's not "safe" bc ppl can "steal" info.
Whatever, I got it now, doesn't matter anymore. |
|
|
|
|