Ok so i have a from that people are using on our site to download a software application….There are actually 4 different forms that are linking to the same php script and i need to redirect all of them to the thank_you page with the $_POST[‘application_to_download’] the problem i am having is how do i send this variable with the php header..here is my code
this will just open the download
header("location:".$_POST['application_to_download']);
which works great but i need the user to be redirected to the thank_you page…so my second approach was to try the post approach
$post_data = "software={$_POST['application_to_download']}";
$content_length = strlen($post_data);
header('POST /downloads/thank_you HTTP/1.1');
header('Host: localhost');
header('Connection: close');
header('Content-type: application/x-www-form-urlencoded');
header('Content-length: ' . $content_length);
header('');
header($post_data);
Im not sure whats going on with this approach but its just not redirecting at all and lastly i can do this
header("location:"./downloads/thank_you?software=$_POST['application_to_download']);
something like that but the url looks like this
http://somesite.com/downloads/thank_you?software=videovision10_1_07.exe
which is not the prettiest if you ask me….i mean i know i can do this but i was looking for an alternative….btw here is why i need it on the thank_you page
<title>Thank You</title>
</head>
<body onload="window.location = '<?php print $_POST['software']; ?>'">
any suggestions
I would recommend instead that you redirect to the thank-you page, and use a meta-refresh to trigger the file download.
and in the thank you page:
Give that a shot..
edit: Now I see you mentioned the GET variable… Do you really think people are looking at your URL and judging it?