How to pass variables – PHP

  php

Q(Question):

In the amount area i want user should enter his own amount and he should be redirect to the page of payment gateway for uniquie id its done…

but for the amount i seek help


<?php
require("libfuncs.php3");
$Merchant_Id = "1235123312" ;//This id(also User Id) available at "Generate Working Key" of "Settings & Options"
$Amount = " " ;//your script should substitute the amount in the quotes provided here
$Order_Id = "SA14329" ;//your script should substitute the order description in the quotes provided here
$Redirect_Url = "http://www.lordchennai.org/" ;//your redirect URL where your customer will be redirected after authorisation from CCAvenue
$WorkingKey = "1254232241" ;//put in the 32 bit alphanumeric key in the quotes provided here.Please note that get this key ,login to your CCAvenue merchant account and visit the "Generate Working Key" section at the "Settings & Options" page.
$Checksum = getCheckSum($Merchant_Id,$Amount,$Order_Id ,$Redirect_Url,$WorkingKey);
$billing_cust_name="";
$billing_cust_address="";
$billing_cust_state="";
$billing_cust_country="";
$billing_cust_tel="";
$billing_cust_email="";
$delivery_cust_name="";
$delivery_cust_address="";
$delivery_cust_state = "";
$delivery_cust_country = "";
$delivery_cust_tel="";
$delivery_cust_notes="";
$Merchant_Param="" ;
$billing_city = "";
$billing_zip = "";
$delivery_city = "";
$delivery_zip = "";
?>
<form method="post" method="post" action="https://www.ccavenue.com/shopzone/cc_details.jsp">
<input type=hidden name=Merchant_Id value="<?php echo $Merchant_Id; ?>">
<input type=hidden name=Amount value="<?php echo $Amount; ?>">
<input type=hidden name=Order_Id value="<?php echo $Order_Id; ?>">
<input type=hidden name=Redirect_Url value="<?php echo $Redirect_Url; ?>">
<input type=hidden name=Checksum value="<?php echo $Checksum; ?>">
<input type="HIDDEN" name="billing_cust_name" value="<?php echo $billing_cust_name; ?>">
<input type="HIDDEN" name="billing_cust_address" value="<?php echo $billing_cust_address; ?>">
<input type="HIDDEN" name="billing_cust_country" value="<?php echo $billing_cust_country; ?>">
<input type="HIDDEN" name="billing_cust_state" value="<?php echo $billing_cust_state; ?>">
<input type="HIDDEN" name="billing_zip" value="<?php echo $billing_zip; ?>">
<input type="HIDDEN" name="billing_cust_tel" value="<?php echo $billing_cust_tel; ?>">
<input type="HIDDEN" name="billing_cust_email" value="<?php echo $billing_cust_email; ?>">
<input type="HIDDEN" name="delivery_cust_name" value="<?php echo $delivery_cust_name; ?>">
<input type="HIDDEN" name="delivery_cust_address" value="<?php echo $delivery_cust_address; ?>">
<input type="HIDDEN" name="delivery_cust_country" value="<?php echo $delivery_cust_country; ?>">
<input type="HIDDEN" name="delivery_cust_state" value="<?php echo $delivery_cust_state; ?>">
<input type="HIDDEN" name="delivery_cust_tel" value="<?php echo $delivery_cust_tel; ?>">
<input type="HIDDEN" name="delivery_cust_notes" value="<?php echo $delivery_cust_notes; ?>">
<input type="HIDDEN" name="Merchant_Param" value="<?php echo $Merchant_Param; ?>">
<input type="HIDDEN" name="billing_cust_city" value="<?php echo $billing_city; ?>">
<input type="HIDDEN" name="billing_zip_code" value="<?php echo $billing_zip; ?>">
<input type="HIDDEN" name="delivery_cust_city" value="<?php echo $delivery_city; ?>">
<input type="HIDDEN" name="delivery_zip_code" value="<?php echo $delivery_zip; ?>">
<INPUT TYPE="submit" value="submit">
</form>

A(Answer):

What do you need help with? Where’s the amount? is it a field? Why can’t you use form to submit it to global var like SESSION POST or GET?

Dan

A(Answer):

Amount is at line no 42 which should match with amount at line no 11.

On the whole i need the user to enter the amount of his own choice.

A(Answer):

Have the user fill out a form, using either GET or POST, and then grab that value.


<form method="post">
<input type="text" name="user_amount" />
<input type="submit" />
</form>
<?php
if (empty($_POST['user_amount']))
{
echo "Please enter the amount in the form.";
}
else
{
echo "The amount is: ", $_POST['user_amount'];
}
?>

Remember, you’ll have to validate the user-submitted data (there are nasty people out there).

A(Answer):

please format the code if anyone could do that it will be really helpful for me..

A(Answer):

Amount is at line no 42 which should match with amount at line no 11.

On the whole i need the user to enter the amount of his own choice and redirect the amount to cc avenue page..

A(Answer):

How can I get the payment results value into my site database?

I am able to pass the values from my database to their shopping cart but i am not able to figure out how can i get the the reults variables to my database? any guess kindly help me for the same

LEAVE A COMMENT