diff options
author | Joe Robinson <joe@lc8n.com> | 2015-12-11 17:02:37 +0000 |
---|---|---|
committer | Joe Robinson <joe@lc8n.com> | 2015-12-11 17:02:37 +0000 |
commit | 07e0c2aa0b5b1866815b8b0f24b0dd3c71d05634 (patch) | |
tree | 8b34072c941dca3cde6260962ababe4a7e9eaa91 | |
parent | 56c10325923bc297cd910c81754c8a906f613bd1 (diff) |
Fix upload function by passing config values
-rwxr-xr-x[-rw-r--r--] | upload_file.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/upload_file.php b/upload_file.php index 3f35524..500c4b2 100644..100755 --- a/upload_file.php +++ b/upload_file.php @@ -51,14 +51,14 @@ if ($_FILES["file"]["error"] > 0) { $fileurl = "$url" . $_FILES["file"]["name"]; echo "URL: <a href=\"$fileurl\">$fileurl</a><br>"; echo "Size: " . size_readable($_FILES["file"]["size"], null, "bi"); - if (isset($notificationurl)) { - send_upload_notification($fileurl); + if (isset($posturl)) { + send_upload_notification($fileurl, $posturl, $postchannel); } } } -function send_upload_notification($fileurl) { - $data = array('url' => $fileurl, 'channel' => $notificationchannel); +function send_upload_notification($fileurl, $posturl, $channel) { + $data = array('url' => $fileurl, 'channel' => $channel); $options = array( 'http' => array( @@ -69,7 +69,7 @@ function send_upload_notification($fileurl) { ), ); $context = stream_context_create($options); - file_get_contents($url, false, $context); + file_get_contents($posturl, false, $context); } ?> </p> |