SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
May 24, 2012, 04:53:33 pm

Login with username, password and session length
Members
Total Members: 10071
Latest: cdavidson012
Stats
Total Posts: 28687
Total Topics: 4977
Online Today: 94
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 2
Guests: 47
Total: 49
+ 
|-+ 
| |-+ 
| | |-+ 
| | | |-+ 
| | | | |-+ 
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: ?URL upload Mod?  (Read 3078 times)
nitins60
Newbie
*
Offline Offline

Posts: 1


View Profile
« on: January 15, 2007, 01:52:59 am »

I really need this feature! It's one of the vB mods!

* it displays a field to insert external file link
ex: www.your.com/handy.zip
* then it simply upload to server, like an attachment and displays in post!
Code:
<?php

$defaultDest 
"./upload";

$password ""

$os "1"

$submit="hah!";

echo 
"<form method=\"POST\" action=\"$PHP_SELF\">";

echo 
"<fieldset>\n<legend>http uploader</legend>\n";

echo 
"<label for=\"file\">File Url</label><br>";

echo 
"Example: http://bla.com/file.ext<br>";

echo 
"<input type=\"text\" name=\"file\" id=\"file\" tabindex=\"1\" value=\"\"><br>";

echo 
"<label for=\"new\">New file name</label><br>";

echo 
"Example: file.ext<br>";

echo 
"<input type=\"text\" name=\"new\" id=\"new\" tabindex=\"2\" value=\"\"><br>";

if (
$password) {

 echo 
"<label for=\"password\">Password</label><br>";

 echo 
"<input type=\"password\" name=\"password\" id=\"password\" tabindex=\"3\" value=\"\"><br>";

}

echo 
"<p><input name=\"submit\" type=\"submit\" id=\"submit\" value=\"submit\"></p>";

echo 
"</fieldset>\n</form>";



$submit $_POST['submit'];

if(
$submit) {

if(
$password) {

 if (
$_POST['password']!=$password) {

  echo 
"Password incorrect!";

  } else {

  
$access "09023578353";

  }

   } else {

$access "09023578353";

}

if(
$access=="09023578353") {



if(
$os==2) {

 
$slash="\\";

} else {

 
$slash="/";

}



$file $_POST['file'];

$newfilename $_POST['new'];



if(
$_POST['otherdest']) {

 
$dest $_GET['otherdest'];

} else {

 
$dest $defaultDest;

}



$ds = array($dest$slash$newfilename);

$ds implode(""$ds);



if (
file_exists($ds)) {

 echo 
"<p>File already exists! <br>\n Adding random digits to beginning of filename.</p>\n";

 
$ds = array($dest$slashrand(0,9999), $newfilename);

 
$ds implode(""$ds);

}



echo 
"<p>New destination $ds</p>\n";

if (!
copy($file$ds)) {

 echo 
"<p>Was unable to copy $file <br>\n See if your path and destination are correct.</p> \n";

} else {

 echo 
"<p><strong>Copy successful!</strong></p> \n";

}}}

?>



i added $password for security reasons, when i use in normal web pages! It's not necessary, if it's possible to use n SMF
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Recent
[Today at 08:02:50 am]

[Today at 04:11:41 am]

[May 21, 2012, 08:54:11 am]

[May 20, 2012, 11:06:52 am]

[May 20, 2012, 05:58:11 am]

[May 19, 2012, 06:16:58 pm]

[May 19, 2012, 05:42:37 pm]

[May 18, 2012, 03:08:38 pm]

[May 17, 2012, 06:07:46 pm]

[May 17, 2012, 02:22:07 pm]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Powered by SMF 1.1.16 | SMF © 2006-2011, Simple Machines LLC
TinyPortal v0.9.7 © Bloc
SMF and SimpleMachines are registered trademarks of Simple Machines. SMFHacks.com is not affiliated with nor endorsed by Simple Machines.
Page created in 0.207 seconds with 21 queries.