Deanznet Posted November 5, 2010 Share Posted November 5, 2010 require_once 'includes/upload.class.php'; $upload = new uploads(); $details = $upload->getFileInformation($id); <?php echo $details['upload_desc']; ?> then here the class. require_once 'db.class.php'; class uploads extends database { private $uploadData; function uploadFile() { public function getFileInformation($id) { $this->uploadData = $this->readData("uploadfiles", "upload_id", $id); return $this->uploadData; } But it wont work! Quote Link to comment https://forums.phpfreaks.com/topic/217856-class-work-on-other-host-but-wont-work-now/ Share on other sites More sharing options...
PFMaBiSmAd Posted November 5, 2010 Share Posted November 5, 2010 But it wont work! ^^^ Telling us that something won't work is pointless. We already know that since you are posting on a help forum. You have got to tell us exactly what symptom you observed in front of you when you tried it. Quote Link to comment https://forums.phpfreaks.com/topic/217856-class-work-on-other-host-but-wont-work-now/#findComment-1130717 Share on other sites More sharing options...
Deanznet Posted November 5, 2010 Author Share Posted November 5, 2010 It wont bring any info up. just blank no errors. <?php echo $details['upload_desc']; ?> that should pull the text in the upload_desc table but it dosen't Quote Link to comment https://forums.phpfreaks.com/topic/217856-class-work-on-other-host-but-wont-work-now/#findComment-1130733 Share on other sites More sharing options...
PFMaBiSmAd Posted November 5, 2010 Share Posted November 5, 2010 I don't see any code that is setting $id to a value before you execute the following statement - $details = $upload->getFileInformation($id); Quote Link to comment https://forums.phpfreaks.com/topic/217856-class-work-on-other-host-but-wont-work-now/#findComment-1130736 Share on other sites More sharing options...
Deanznet Posted November 5, 2010 Author Share Posted November 5, 2010 Heres the full page. require_once 'includes/upload.class.php'; $upload = new uploads(); $details = $upload->getFileInformation($id); $id; preg_match("#/download/([\d]*)-#i", $_SERVER['PHP_SELF'], $id); $id = $id[1]; $details = $upload->getFileInformation($id); $encid = md5(time().mt_rand(101,887)); //echo $offer['id']; //print_r($_GET); <?php echo $details['upload_desc']; ?> I think i know the problem. preg_match("#/download/([\d]*)-#i", $_SERVER['PHP_SELF'], $id); My url looks like this. mysite.com/file/ID/title the other site looked like this othersite.com/download/ID-filename.txt So my question is how do i change preg_match("#/download/([\d]*)-#i", $_SERVER['PHP_SELF'], $id); to match mysite.com/file/ID/filename Quote Link to comment https://forums.phpfreaks.com/topic/217856-class-work-on-other-host-but-wont-work-now/#findComment-1130741 Share on other sites More sharing options...
BlueSkyIS Posted November 5, 2010 Share Posted November 5, 2010 I don't see any code that is setting $id to a value before you execute the following statement - $details = $upload->getFileInformation($id); Ditto. Where is $id set before you perform getFileInformation() on it? And what is this line supposed to be doing? $id; Quote Link to comment https://forums.phpfreaks.com/topic/217856-class-work-on-other-host-but-wont-work-now/#findComment-1130844 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.