tags:

views:

30

answers:

2

I have a header in php which contains a link like

<?php
header("Location: "."https://abc.com/ppp/purchase.do?version=3.0&amp;".
    "merchant_id=<23255>&merchant_site_id<21312>&total_amount=<69.99>&".
    "currency=<USD>&item_name_1=<incidentsupporttier1>&item_amount_1=<1>&".
    "time_stamp=<2010-06-14.14:34:33>&**checksum=<calculated_checksum>**");
?>

when i run this page the value of checksum is calculated and the link is opened

now how checksum is calculated? calculated_checksum=md5(abc);

md5 is an algorithm which calculates the value of checksum based on certain values inside the bracket.

now i want to know how can i pass the value of checksum in the header url

A: 

I am not sure if this is what you mean:

Use string concatenation . :

$calculated_checksum=md5('abc');
header('Location: https://...&amp;checksum=' . $calculated_checksum);

Variables have to start with $.

Felix Kling
A: 
<?php

$cs = md5("abc"); //Puts 900150983cd24fb0d6963f7d28e17f72 (the hash of abc) into  the variable named $cd

header("Location: "."https://abc.com/ppp/purchase.do?version=3.0&amp;".
    "merchant_id=<23255>&merchant_site_id<21312>&total_amount=<69.99>&".
    "currency=<USD>&item_name_1=<incidentsupporttier1>&item_amount_1=<1>&".
    "time_stamp=<2010-06-14.14:34:33>&**checksum=" . $cs . "**"); //Redirect the page to the new page with the checksum concatenated onto the end

?>

Is that what you were looking for?

Chief17