Jump to content

Recommended Posts

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!

 

 

 

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.

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

 

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;

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.