Problem calling function from download page

That should have a localhost if you are running it locally.

So, we can start walking through the steps. 1, you commented out where it calls the function. That means there is nothing to do on the page. If you uncomment that and still get a white screen, we will need to start debugging.

The line currently reads:
<a href=“download/mydloader.php?f=<?php echo "{$isoname}";?>”> .
Yes, I’m running it locally and everything else works fine.

Below this write,

echo "Made it here!";

If that makes it on to the screen, you know you are in the correct file.

OK, here’s what I did: I modified the top of index.php as follows:
<?php
session_start();

$php_scripts = '/home/larry/web/test/php/'; 
$down_php = '/home/larry/web/test/public_html/download/';  // added

require $php_scripts . 'PDO_Connection_Select.php';
require $php_scripts . 'GetUserIpAddr.php';
require $down_php . 'mydloader.php';
//*******************************
//   Begin the script here

$ip = GetUserIpAddr();
if (!$pdo = PDOConnect("foxclone")):
{
	echo "Failed to connect to database" ;
    exit;
} 
endif
?>

I tried what you suggested and I’m back to the 404 error.

You’re jumping around. What do you want to fix first?

OK, let’s concentrate on getting to the correct mydload.php first.

Then let’s start with this

Nope, not seen. What next?

Add this to the top of the file,

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

Will do. I just checked MyphpAdmin and an entry WAS made in the database but still no download. I’ll make the change and get back to you. Which file, index.php or mydloader.php?

All of them. Or you can change the error reporting settings in your INI file to always show errors in your dev environment.

If it inserted but didn’t output a file, I would guess it couldn’t find the file, but the var_dump should have shown something as well.

Put that code at the top of both files, right below the <?php. Still no errors or var_dump seen. Makes the entry to the database with no filename and goes to a 404 error. I don’t think the filename is being passed.

Easy to check, is it in the url when you get there, or the link from the page that should send you?

Yes, it’s in the url of the 404 page. Seeing as mydloader.php is in the download directory, why can’t it find the file and why isn’t the filename being entered in the db as it should?

Does your index page also insert a record?

Yes, when the user opens the page an insert is made of their ip address. When they download, an entry should be made of their ip and the filename. Right now, just the ip is being entered when they download.

Are these in different tables? Or is the IP entered in the table and they another entry is made in the same table?

What I believe is happening, is the page isn’t getting hit, and you are seeing the insert from the index page, not the download page.

same table. Primary key is an autoincrement field.

If the download directory is above the public_html directory, it is not accessible and cannot be gone to currently. The download file needs to be moved to the same directory that the index file is in.

Sponsor our Newsletter | Privacy Policy | Terms of Service