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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:34:07+00:00 2026-05-13T18:34:07+00:00

I have two ways to check from user: 1.if user input (Amount field <

  • 0

I have two ways to check from user:

1.if user input (Amount field < 5(user credit):
   do update database the remain amount in my database table.
2.if user input(Amount field) > 5(user credit):
  Do paypal transaction with the submit form.



 <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" id="payPalForm">        
    <input type="hidden" name="item_number" value="01 - General Payment to FreelanceSwitch.com">
    <input name="item_name" type="hidden" id="item_name"  size="45" value="Posting job">    
    <input type="hidden" name="cmd" value="_xclick">    
    <input type="hidden" name="no_note" value="1">    
    <input type="hidden" name="business" value="seller_1265789181_biz@xxx.xxx.xx">    
    <input type="hidden" name="currency_code" value="USD">    
    <input type="hidden" name="return" value="http://freelanceswitch.com/payment-complete/">       
    Paying Page:<input name="amount" type="text" id="amount" size="5">   
    <input type="submit" name="Submit" value="Pay">            
    </form>

Anybody could tell me how to do with the paypal submit form with the conditions.?

thanks.

Thanks @Donny Kurnia ,now I have tried:

EDIT::

function compare_user_credit($paying_price, $user_credit){

    $db = &JFactory::getDBO();
    $user =& JFactory::getUser();
    $user_id = $user->get('id');

    if ($paying_price <= $user_credit) {        
        $remain_credit = $user_credit - $paying_price;
        //DO UPDATE:enough credit
        update_user_credit_after_paying($remain_credit,$user_id);
        $action_after_paying = header("Location: index.php?xxxx=5");
     }
    # Case2 direct to paypal with the submit form.
    else if ($paying_price > $user_credit){
       //Need submit form to paypal.
       $action_after_paying = header("Location: index.php=xxxx&paypal=".$_POST["amount"]);
    }
    return $action_after_paying;
}
$output = '<form method="POST" > ';
     $output .='<h1>Credit:'.get_credit().'</h1>';
     $output .= ' Paying Page <input type="text" name="amount" size=3 max_length=5 />';
     $output .='<input type="submit" name="pay" value="pay" />' ;
     echo $output;

if(isset($_POST["pay"])){
    compare_user_credit($_POST["amount"], $user_credit);

}

HOw Could I do with Paypal in Case 02.(direct to paypal with submit form.)

  • 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-13T18:34:07+00:00Added an answer on May 13, 2026 at 6:34 pm

    Maybe you can receive the form submit to your own code and then check it’s value. If it satisfy the first condition, do the database update. If it satisfy the second condition, redirect the user to a page that have hidden form that will submit to paypal. You can populate the data in this hidden form using data from database or previous form input, and put a javascript code so the form will automatically submitted when the page is loaded.

    In my code, I use Micah Carrick’s Paypal IPN class to send data to paypal. The class have a sample code on how to display the hidden form, with a submit button in case the javascript is disabled.

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

Sidebar

Related Questions

Basically you have two ways for doing this: for (int x = 0; x
I have two different ways of displaying items in a WPF application. The first
I have seen two ways of acquiring and disposing resources. Either: Resource resource =
I display some objects that have thumbnails in two ways: one in a DataGridView,
I have recently been thinking about the difference between the two ways of defining
I have some Java code that uses curly braces in two ways // Curly
I have two elements: <input a> <input b onclick=...> When b is clicked, I
I have two applications written in Java that communicate with each other using XML
I have two arrays of animals (for example). $array = array( array( 'id' =>
I have two arrays of System.Data.DataRow objects which I want to compare. The rows

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.