Im making a script to create a tempoary text file to download and redirect back to a page,but im having the issue that everything after the header information is sent goes into the text file upon download.
<?php
session_start();
include('session.php');
//echo $login_session;
require_once "getconnected.php";
$connection = getConnected();
header('Content-Type: application/octetstream; name="file.txt"');
header('Content-Type: application/octet-stream; name="file.txt"');
header('Content-Disposition: attachment; filename="file.txt"');
?>
Hello, world.
<script>
window.location.href="/usercp/monitorproducts.php";
</script>
<?
?>
as you can see the javascript code goes into the text file due to the header.. what can i do?
thank you.