kayz100 Posted February 25, 2013 Share Posted February 25, 2013 Hi Guys Thanks for all the help. I managed to ficx my form issues and now I have another problem 'DOWNLOAD SCRIPT". I think the main problem I have here is the directory for the download. Everything works fine on EasyPHP development plartform at home but when I tried it on my mates site www.drumafrica.biz it outputs the follwing error: Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /homepages/25/d423356896/htdocs/FTPweb/DRUM/MyDwnlods/index.php on line 5 I think i am failing to write the correct path (directory) for php to find live path, on the home server I simply use "/" and it works. I use Filezilla for FTPing. I nearly forgot I am using windows 7 and XP. All my PHP is tested on EasyPHP5. I ahve indluded the script that I am having a problem with. Please log on to drumafrica.biz. The file will be on there until tomorrow, tuesday 26th,pleae help thanks. List of files inside MyDwnlds 1. index.php 2. downloadme.php 3. MyDownloads folder contains files to download -------------- index.php code: ---------------- <?php error_reporting(-1); define( "DOWNLOAD_ROOT", __DIR__ . "/" ); //This is the problem require_once("downloadme.php"); $download_path = DOWNLOAD_ROOT . "Mydownloads/"; $file = $_REQUEST['f']; $args = array( 'download_path' => $download_path, 'file' => $file, 'extension_check' => TRUE, 'referrer_check' => FALSE, 'referrer' => NULL, ); $download = new rocasa_download( $args ); $download_hook = $download->get_download_hook(); //$download->rocasa_print($download_hook); //exit; if( $download_hook['download'] == TRUE ) { /* You can write your logic before proceeding to download */ /* Let's download file */ $download->get_download(); } ?> Feel free to email me kay98kl@yahoo.com Quote Link to comment https://forums.phpfreaks.com/topic/274912-download-script-problem/ Share on other sites More sharing options...
requinix Posted February 25, 2013 Share Posted February 25, 2013 Your website is not running PHP 5.3. Can you upgrade it? Quote Link to comment https://forums.phpfreaks.com/topic/274912-download-script-problem/#findComment-1414790 Share on other sites More sharing options...
kayz100 Posted February 25, 2013 Author Share Posted February 25, 2013 I am with 1and1, have no idea what sort of PHP they are running. Do you have an idea of download_path? I am really stuck on this mate Quote Link to comment https://forums.phpfreaks.com/topic/274912-download-script-problem/#findComment-1414803 Share on other sites More sharing options...
requinix Posted February 25, 2013 Share Posted February 25, 2013 I'll take that as a "no" then. define( "DOWNLOAD_ROOT", __DIR__ . "/" ); __DIR__ is for PHP 5.3+ only. For define( "DOWNLOAD_ROOT", dirname(__FILE__) . "/" ); You should install PHP 5.2 on your machine at home so there aren't any more of these problems. Quote Link to comment https://forums.phpfreaks.com/topic/274912-download-script-problem/#findComment-1414870 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.