NameSilo

Upload URL Script

Spaceship Spaceship
Watch

newsiness

VIP Member
Impact
49
<?php
if ($_GET[xfer]) {
if ($_POST[from] == "") {
print "You forgot to enter a url.";
} else {
copy("$_POST[from]", "$_POST[to]");
$size = round((filesize($_POST[to])/1000000), 3);
print "transfer complete.<br>
<a><a href=\"$_POST[from]\">$_POST[from]</a><br>
<a><a href=\"$_POST[to]\">$_POST[to]</a> : $size MB";
}
} else {
print "<form action=\"$PHP_SELF?xfer=true\" method=post>
from(http://): <input name=from><br>
to(filename): <input name=to><br>
<input type=submit value=\"transload\">";
}
?>
I copied the php script above and saved as save.php file.

This script uploads a url to webserver using form method.
When I click the "transload" button, the browser address bar this
save.php?xfer=true

What is the exact full path?

Thanks!!!
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
i can't even tell what this script is supposed to do. from() and to() aren't any php functions i've ever seen, and you seem to be gettin filesize of post variables that aren't set. also, for post, you need single quotes around the name, like $_POST['from'] or $_POST['to'].

perhaps if you could elaborate on what the script should do, we could help.
 
0
•••
0
•••
uhhhh... it seems to be working fine... what do you mean the "exact full path"? I believe that the link to see the page that displays

Code:
transfer complete.
http://www.google.com
google : 0.006 MB

isn't available to go to directly because the script shows that after it gets s form submitted to it.
 
0
•••
It is working fine....
what i mean is that....i want to know the web url after i click the "transload" button.
for example
testing/save.php?xfer=true?from=http://.....?to=abj.jpg (something like this)
 
0
•••
Hi
Yes its work for me .
Thanks
 
0
•••
newsiness said:
It is working fine....
what i mean is that....i want to know the web url after i click the "transload" button.
for example
testing/save.php?xfer=true?from=http://.....?to=abj.jpg (something like this)
after a user click that button, it always go to http://newsiness.com/testing/save.php?xfer=true :?

Btw it seems you must filter the "to(filename)" to prevent php file there (or for example only allow txt and htm / html filess)
 
0
•••

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back