Forum Moderators: coopster

Message Too Old, No Replies

File download with PHP and SQL

PHP-SQL query that gets all info from SQL

         

AlexB77

6:55 pm on Apr 19, 2011 (gmt 0)

10+ Year Member Top Contributors Of The Month



Hi,

I have a table in my SQL with 5 columns:
1. file_id
2. file_name
3. file_add
4. soft_name
5. file_display_name

Now once download link is clicked (/file-download.php?urlid=(downloadable_file_name) with php script that I have in the "download.php2 I am able to get file get additional link to the alternative download and also obtain name and extention of the ACTUAL file, but I have to use iframes to output results on my file-download.php page

<iframe name="link" src="dl_click1.php?urlid=<?=$_GET['urlid']?>" width="100%" height="30px" frameborder="0" scrolling="no" marginwidth="0" marginheight="0"></iframe><br>

<iframe name="link" src="file-name1.php?urlid=<?=$_GET['urlid']?>" width="100%" height="30px" frameborder="0" scrolling="no" marginwidth="0" marginheight="0"></iframe><br>

<iframe src="buy1.php?urlid=<?=$_GET['urlid']?>" width="0%" height="0px" frameborder="0" scrolling="no" marginwidth="0" marginheight="0" ></iframe><br>

<iframe src="add.php?urlid=<?=$_GET['urlid']?>" width="100%" height="500px" frameborder="0" scrolling="no" marginwidth="0" marginheight="0"></iframe><br>

to get results separately and also push download through the browser.

My question is: if I would be using file-download.html instead of using file-download.php and also want to have results in something different rather iframe how would I be able to do it.

the second question I would also like to use the name of the software (not the file) from (4. soft_name) of my SQL to be displayed in <H1>Thanks for downloading (software name)</H1> and also in title and and description in the meta.

any help would be much appreciated

coopster

2:06 pm on May 24, 2011 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I'm not quite certain I understand the question, but if you want to parse .html files as .php all you need to do is update your server configuration by adding the .html extension to the PHP handler.

Regarding the second question, can you push the <h1> contents into the server-side processing program that delivers the iframe contents?