Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5975405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:04:50+00:00 2026-05-22T21:04:50+00:00

Ok so i have a from that people are using on our site to

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:04:50+00:00Added an answer on May 22, 2026 at 9:04 pm

    I would recommend instead that you redirect to the thank-you page, and use a meta-refresh to trigger the file download.

    header('Location: /thank_you_page.php?redirectTo=' . $_POST['app_to_dl']);
    

    and in the thank you page:

    echo "<META HTTP-EQUIV=\"REFRESH\" CONTENT=\"1;URL=" . $_GET['redirectTo'] . "\">";
    

    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?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have heard from many people that usage of templates make the code slow.
I would love to get some tips from other people that have had this
I have an array that is produced from people wanting to reserve a time
I have read from some article that say's Apple doesn't approve the application which
We have written an application that manages OpenVPN from the tray as an add-on
Our ldap is set up so that we have multiple different organizational units (ou).
A number of people in my organization have different email names from perforce names,
I have a asp.net web content from that have a asp.net textbox and I
I have learnt from this post that always use <a> tags or <button> tags
I have some data from JQGrid that should be exported to excel. So, we

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.