How to pass variables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Illayaraja

    #1

    How to pass variables

    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

    Code:
    <?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>
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    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

    Comment

    • Illayaraja

      #3
      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.

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

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

        Code:
        <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).

        Comment

        • illayaraja

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

          Comment

          • illayaraja

            #6
            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..

            Comment

            • itsmesaroya
              New Member
              • Sep 2011
              • 2

              #7
              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

              Comment

              Working...