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 8399557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:20:26+00:00 2026-06-09T21:20:26+00:00

I have the following code that allows the person to choose the donation amount

  • 0

I have the following code that allows the person to choose the donation amount and download the file. At the moment this allows the person to put in 0 and download. I want to make the minimum 0.99. How could I make it compulsory to make a donation otherwise don’t download. I appreciate your help.

 <?php

echo "<p>Donate fixed amount to CharityName</p>
<form method='POST' action=''>
<select name='currency_code'>
<option value='EUR'>EUR</option>
<option value='GBP'>GBP</option>
<option value='USD'>USD</option>
<input type='text' name='donate_amount' value='0'>
<input type='submit' name='submit' value='Donate'></form>";

if(!empty($_POST['submit'])) {
// Form has been submitted
  if($_POST['donate_amount'] > 0) {
// Redirect to PayPal
header('Location: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&item_name=Donation for XXX&amount='.$_POST['donate_amount'].'&currency_code='.$_POST['currency_code'].'&business=mypaypalemail@here.tld&cbt=Download the file&return=http://link-to-the-file&cancel_return=http://back-to-my-website');
}
else {
// No donation amount entered - proceed to file directly
header('Location: http://link-to-the-file/');
}
}

?>
  • 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-09T21:20:28+00:00Added an answer on June 9, 2026 at 9:20 pm

    See a sample:

    if(!empty($_POST['submit'])) {
        if($_POST['donate_amount'] >= 0.99) {
            // Redirect to PayPal
        } else {
            exit('Please donate at least $.99');
        }
    }
    

    For Google analytics, I can’t answer you, sorry.

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

Sidebar

Related Questions

I have the following code that allows my console app to go to the
I have the following code that fails when i run it. my .h file:
I have the following code that returns a .CSV file when a link is
I have some code that allows users to upload file attachments into a varbinary(max)
I have the following code that allows me to position it on the top.
I have the following code that allows me to load a set URL each
I have found some sample code on codeproject that allows for user impersonation. This
I have the following code that allows for a user to hover over an
I have the following jquery code that allows me to use tabs, to tab
I have the following code that works perfectly. It allows the user to 'like'

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.