Jump to content

crooksey

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Posts posted by crooksey

  1. What I am trying to do in form 1 is..

     

     

            $digest = md5($digest_this); //generate the md5 hash$amount = $_POST['amount']; //what I think I am doing here is posting the data so it can be retrived $trans_id = $_POST['trans_id']; //by a get request on from 2, this is where I need help$merchant = $_POST['merhcant'];$remotepassword = $_POST['remotepassword'];[code]I need to work out how to send this data to form two, thats all  So the data thats stored insinde these variables can then be passed to another website

     

  2. I have two forms that I have created.

     

    I wonder if someone could point out where I am going wrong, all data is commented so it should be easier to understand.

     

    form1.php

     

    <?php     $digest = 0;    $amount = 0;$trans_id = 0;$merchant = "so";    $remotepassword = "s0";        if ($_POST) {        $digest_this = $_POST['trans_id'] + $_POST['amount'] + $remotepassword; //combine all my values to be md5'd        $digest = md5($digest_this); //generate the md5 hash	$amount = $_POST['amount']; //what I think I am doing here is posting the data so it can be retrived 	$trans_id = $_POST['trans_id']; //by a get request on from 2, this is where I need help	$merchant = $_POST['merhcant'];	$remotepassword = $_POST['remotepassword'];    } // end $_POST?>      <form action="part2.php" method="post">    <p>    <label for="trans_id">Invoice Number(s): </label>              <input id="trans_id" type="text" name="trans_id" /><br />    <label for="amount">Amount Paying: </label>              <input id="amount" type="text" name="amount" /><br />		  		  		  		  <input value="Send" type="submit" /> <input type="reset" /> </p></form>

     

     

    form2.php

     

    <?php if ($_GET) {	$digest = $_GET['digest'];  //here I think I am retriving the data I sent with a post request	$merchant = $_GET['merhcant']; //and then storing it in variables	$remotepassword = $_GET['remotepassword'];	$amount = $_GET['amount'];	$trans_id = $_GET['trans_id'];	} // end $_GET?><form action="https://www.secpay.com/java-bin/ValCard" method="post">    <p>    <label for="firstname">First Name: </label>              <input id="firstname" type="text" name="firstname" /><br />    <label for="lastname">Last Name: </label>              <input id="lastname" type="text" name="lastname" /><br />    <label for="account">Account Number: </label>              <input id="account" type="text" name="account" /><br />    <label for="housenumber">House Number/Name: </label>              <input id="housenumber" type="text" name="housenumber" /><br />          <label for="postcode">Postcode: </label>              <input id="postcode" type="text" name="postcode" /><br />        <label for="email">Email: </label>              <input id="email" type="text" name="email" /><br />    <label for="notes">Notes: </label>              <input id="notes" type="text" name="notes" /><br /><!-- Here I have taken all the inputs from the form that are required to be sent --><!-- and given the input_id names as the values required by the pay point servers -->        <input name="callback" value="http://www.sol.co.uk/authorised;http://www.sol.co.uk/declined" type="hidden" />    <input name="merchant" value="<?php echo "$merhcant"; ?>" type="hidden" /> <!--here I am populating hidden fields with php script data-->    <input name="remotepassword"  value="<?php echo "$remotepassword"; ?>" type="hidden" />    <input name="req_cv2" value="true" type="hidden" />    <input name="options" value="test_status=true" type="hidden" />        <input name="digest" value="<?php echo "$digest"; ?>" type="hidden" />    <!-- Here I have defined all of the constant hidden values that never change --> <!-- Now in this section of the form I have defined the value that will change, combining the three fields --> <!-- that are required in order to create the digest value -->    <input value="Send" type="submit" /> <input type="reset" /> </p></form>

     

     

    Thanks for looking, I think its something basic im missing, first time doing this if you hadnt of guessed :)

  3. I have inhertied some code that I have been told to get working. not very happy about it, but think its just some basic php.

     

    The form has three inputs two user inputs and one hidden value..

     

        <label for="trans_id">Invoice Number(s): </label>
                  <input id="trans_id" type="text" name="trans_id" /><br />
        <label for="amount">Amount Paying: </label>
                  <input id="amount" type="text" name="amount" /><br />
    
    <input name="remotepassword" value="password1" type="hidden" />

     

    Now before submitting the form (post method) I need to create an md5 has of all of these values called digest. (hidden of course).

     

    The code I was thinking of was..

     

    <?php
    $str = trans_id:amount:remotepassword;
    
    string md5 ( string $str [, bool $raw_output = false ] ) 
    ?> 
    

     

    Now that code should generate the md5 hash, how do I then assign this to a value called "digest" to be added to the post form?

  4. I am trying to setup SAGE PAY for my web site, but the default scripts that sage pay provide assume you are using a shopping cart. They supply a "build order" script, which is where the value and payment information is entered.

     

    On my site am after just three inputs as opposed to a cart, so instead of users picking products from a shopping cart system, I simply want users to be presented with three input fields...

     

    Account Number

    Invoice Number

    Amount Paying

     

    But I need to try and keep the same variable names so the rest of the script continues to work...

     

    the current build order script is ......

     

    http://pastebin.com/8psGDCZK

     

    I need a very very simple page instead of this one, best way to start/approach this?

     

     

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.