Php Mysqli So Download

Active5 years, 7 months ago

I am creating PHP page that allows users to download files when they click in this button:

Playlist: CRUD with PHP and MySQLi Tutorial 2016 [Part 1] Update Notes 16 June,2016,In these video you can also see How To Insert & Display Data into Mysql. Join Stack Overflow to learn, share knowledge, and build your career. Create and save this script with any file name and a.php extension, like 'mysql_test.php,' in the www directory, which is the same location as the phpinfo.php script from above. If you click on Run script in the PHP drop down, you'll see the output of the script in the output window. Will install package containing both old one and the new one, so afterwards all you need to do is to add in your php.ini, restart apache and it should work.

then the page redirect to download.php, code:

Look for the file set up in the directory you have chosen in the previous step. Download driver printer hp deskjet 3920 untuk windows 7.

however, wehn i click in download i always get the massage of the last else statement 'error no id was passed', but i can't find the problem, is the problem that i made the primary key of the file is the name??

Samer El GendySamer El Gendy

Mysqli Php Example

7882 gold badges16 silver badges42 bronze badges

4 Answers

If your link looks like this:

Then the GET variable will be 'id' as in $_GET['id'] and not$_GET['file_name']


Jeff LambertJeff Lambert
21k3 gold badges54 silver badges80 bronze badges
Sam TSam T

u should use <a href='download.php?id=<?= $row['file_name'];?>'>

then use $_GET['id'] since id is the variable u pass in url not $_GET['file_name']

2,1653 gold badges22 silver badges39 bronze badges

Mysqli Php Tutorial

Not the answer you're looking for? Browse other questions tagged phpmysqlpdfweb-applicationsdownload or ask your own question.

Comments are closed.