Jump to content

Javascript in an PHP page


joecooper

Recommended Posts

Hi,

 

i am using this script for a php page to download an exe file, it works fine.

 

header('Content-type: application/exe'); 
header('Content-Disposition: attachment; filename="SETUP_file.exe"'); 

@readfile( "SETUP_file.exe" );


?>

 

as i am paying for advertising, i have this JS code that is used for conversion tracking, do i just add this after the php page? should it load properly?

 

<!-- Adengage conversion script -->

<script language="JavaScript" type="text/javascript">

<!--

ae_cust_id = 9723;

ae_amount = 0.00;

ae_landing_page = false;

ae_page_view = true;

ae_registration = false;

ae_lead = false;

ae_sale = false;

//-->

</script>

<script language="JavaScript" src="https://conv.adengage.com/conversion.js">

</script>

<!-- End Adengage conversion script -->

 

 

PS, if anyone knows how to send the file size of the exe file? as it says its not known when downloading the file

Link to comment
https://forums.phpfreaks.com/topic/144263-javascript-in-an-php-page/
Share on other sites

you cant add the javascript code onto that but if you sent your user to one page with that on it then javascript redirected them to the download page (basically what most download sites do).

that way you can display a page with your adds and a download/save window.

also for the file size check out the comments on the php manual header

 

Scott.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.