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

  • SEARCH
  • Home
  • 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 9249375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:10:21+00:00 2026-06-18T10:10:21+00:00

Download link: <a href=download.php?words=2000&sort=popular&type=xml>Download php file</a> download.php <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN

  • 0

Download link:

<a href="download.php?words=2000&sort=popular&type=xml">Download php file</a>

download.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Home</title>
</head>
<body>
<h1>PHP file</h1>

<?php
function get_text($text)  
{  
   ....
}      

function get_time($time)  
{  
   ....
}    

$url = "http://api.xxx.com/info.php?words=".$_GET['words']."&sort=".$_GET['sort']."&type="$_GET['type'];
$xml = simplexml_load_file($url);
if (count($xml))
{
  foreach($xml->book as $book)
  {
    echo ....      
  }
}
?>

</body>
</html>

The download.php is a ready made API php script to provide webmasters upload to their FTP. Webmasters can be choose many options(e.g: download.php?words=2000&sort=popular&type=xml) from a form, then submit the form to get their custom API script.

This is the line that will replace the options after they submit the form.:

$url = "http://api.xxx.com/info.php?words=".$_GET['words']."&sort=".$_GET['sort']."&type="$_GET['type'];

This is the code to force download. But i don’t know how to wrap whole page with $content = “”;. I know how to wrap the HTML codes but how to wrap the PHP function and codes on the page?

header("Content-Disposition: attachment; filename="download.php");
print $content;
  • 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-06-18T10:10:23+00:00Added an answer on June 18, 2026 at 10:10 am

    Not sure if that is what yo want; but you could create a second script that calls the first one, gets the output, and sends that with the mentioned headers:

    <?php
    $words = (int) $_GET['words'];
    $sort = $_GET['sort'];
    
    $url = sprintf("http://localhost/wherever/download.php?words=%d&sort=%s&type=xml", $words, $sort);
    $content = file_get_contents($url);
    
    header("Content-Disposition: attachment; filename="download.php");
    print $content;
    ?>
    

    Call that file “force_download.php” and let the users call <a href="force_download.php?words=2000&sort=popular&type=xml">Download php file</a> instead.

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

Sidebar

Related Questions

I have a href tag that goes like this : href=download.php?file={$sp->attachment_1}&flag=ds&r_id={$userid}&scpl_id={$sp->sp_id}; that works and
I have some html in this format: <div id=logos class=downloadlist> <ul> <li><a href=/toolkit/logos/download.jpg data-image=images/toolkit/logos/one.jpg>First
I have a href tag linking to a php page where I can download
im trying to have one link for a file download and at the same
i wanted to give a link at html page to download. as i am
I've got a download link on page: <a href=124463.mp3>xxxx</a> When user click it, the
i want to have function like delete file from database by using link instead
I am trying to retrieve the first download link from a website, but my
I have a link, which contains downloadble file,now when i am putting that link
How would you go in getting the latest download link for pagecounts from http://dumps.wikimedia.org/other/pagecounts-raw/2011/2011-11/

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.