1

I have post where it has a download button, and I want to save my download link in a row in my server. So in my site it loads the link in the button.

I made this:

 <a href="'.$rows['link'].'" class="btn btn-primary col-lg-12 " role="button">Download</a> 

But it does not open my download link. When I click download it opens the link in my folder as a page, like this:

http://localhost/system/adm/www.mylink.com

I don't want to save the file in my folders, I want to save in my cloud so I can have huge downloads.

And post this link in my server so the post loads the link in my button.

What is the right way to make this work?

Your Common Sense
  • 156,878
  • 40
  • 214
  • 345
James Allan
  • 280
  • 5
  • 18

1 Answers1

1

Links open locally if they don't have "http://" at the beginning, so just add it to all your links :

           ▼
<a href='http://" . $rows['link'] . "' class="btn btn-primary" role="button">Download</a>