rybakov Posted August 19, 2015 Share Posted August 19, 2015 i have an online mysql database that contains a field to store links in it, every row have a unique link to a filewhen the user search for the files i want to put a button in the result table that let the user press on it to download the file from the link of that fileany help? Quote Link to comment Share on other sites More sharing options...
Barand Posted August 19, 2015 Share Posted August 19, 2015 Which bit are you having a problem with? Show your current code Quote Link to comment Share on other sites More sharing options...
rybakov Posted August 19, 2015 Author Share Posted August 19, 2015 sir i just want you to put me on the right way coz i don't know wre to start Quote Link to comment Share on other sites More sharing options...
ginerjm Posted August 19, 2015 Share Posted August 19, 2015 This forum loves to help those who help themselves. With that point clear - until you show an ability to write SOME code, people here usually will not give you code help. If you can't code already then it really doesn't help you for us to give you one line of it. A point to consider is that the button would submit a form to your script that then grabs the input elements hidden in your page's form. If you have multiple sets of info on your webpage, you may have multiple forms embedded in, each one with a button that submits its own form, passing the data needed to the download script. If that makes sense, happy coding! Quote Link to comment Share on other sites More sharing options...
QuickOldCar Posted August 19, 2015 Share Posted August 19, 2015 Since you already have a mysql database I would assume you know how to connect to that database and perform a select query. If not here is 2 links that can help you. http://php.net/manual/en/mysqli.query.php http://php.net/manual/en/pdo.query.php Once you have a loop of results you can echo the row value within an <a> tag and use the download attribute echo "<a href='".$row['link']."' download='".$row['link']."'>".$row['link']."</a><br />"; Quote Link to comment 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.