Jump to content

Class work on other host but wont work now!


Deanznet

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;

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.