Forum Moderators: coopster

Message Too Old, No Replies

SQL query result output

What to use instead of an iFrame

         

AlexB77

8:46 pm on Jun 2, 2011 (gmt 0)

10+ Year Member Top Contributors Of The Month



I have a php script that checks MySQL for a file name and obviously the file path which outputs the result on the final download page for the user.

To output the result I use an IFrames

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

Is there a way to do the same but without using an IFrame?

any help will be very much appreciated.

jspeed

2:28 pm on Jun 3, 2011 (gmt 0)

10+ Year Member



I would just have the relevant download code in a conditional statement, in the same php page. Something like:

if(isset($_GET['urlid']) && !empty($_GET['urlid'] ))
{
// DOWNLOAD LINK
}

else {
// NORMAL DISPLAY
}

There may be a more graceful way to do it, but you get the idea.

AlexB77

10:22 pm on Jun 3, 2011 (gmt 0)

10+ Year Member Top Contributors Of The Month



Thanks for this

I will try this.

The only thing that I am not quite sure about is if it will work on the standard HTML output page?

jspeed

2:49 pm on Jun 6, 2011 (gmt 0)

10+ Year Member



The only thing that I am not quite sure about is if it will work on the standard HTML output page?


Not sure I follow. To use php, you have to have it installed on your server, and it has to be a .php extension, unless you have html setup in your .htaccess to accept php. Something like:

AddType application/x-httpd-php .html
AddHandler x-httpd-php .html

But honestly I am not that familiar with it.