Hi everyone. I need to merge these two codes and make them work. These pages are from a donations system.
Main page, which is working, it redirects you to a page which i don't want it to redirect - where you need to enter the sum you wanna donate.
<?php
$signPassword = ''; # -- Enter your webtopay signature password (go to site, account settings and generate) --
$arrFields = array(
'merchantid' => '000000', # -- Enter WebToPay user ID --
'projectid' => '', # -- If need, enter project ID --
'lang' => 'LIT',
'paytext' => 'Parama [site_name] svetainei.',
'p_email' => ''
);
# *************************************************
# -- How we create sign param --
$signFields = array( 'merchantid', 'orderid', 'lang', 'amount', 'currency', 'accepturl', 'cancelurl', 'callbackurl', 'payment', 'country', 'logo', 'p_firstname', 'p_lastname', 'p_email', 'p_street', 'p_city', 'p_state', 'p_zip', 'p_countrycode', 'test' );
foreach ($signFields as $num => $fName) $dString .= trim($arrFields[$fName]) != '' ? sprintf("%03d", strlen($arrFields[$fName])) . strtolower($arrFields[$fName]) : NULL;
$sign = md5($dString . $signPassword);
# *************************************************
# -- Form & button --
print '<form method="POST" action="https://www.mokejimai.lt/pay/">';
foreach ($arrFields as $num => $value) print '<input type="hidden" size="70" name="' . $num . '" value="' . $value . '">';
print '
<input type="hidden" size="70" name="sign" value="' . $sign . '">
<input type="image" src="https://www.mokejimai.lt/payment/m/m_images/wfiles/i25zov101.gif" border="0" name="submit" alt="Paremkite svetainÄ™! - mokejimai.lt tai saugu ir patikima!">
</TD>
</form>';
?>
And this one is not working, it doesn't redirects you and doesn't fetches the value you enter. I'v tried it both different ways:
<input type="text" name="amount" id="amount" class="input-fields" value="0">
<input type="button" value="Toliau" class="input-button" onClick="window.location.href= 'www.mokejimai.lt/popup2.php?popup_module_name=m_pay&tmpl_name=m_pay_pick_payment_lt&amount=' +document.getElementById('amount').value¤cy=LTL">
<input type="button" value="Toliau" class="input-button" onClick="window.location.href='www.mokejimai.lt/popup2.php?popup_module_name=m_pay&tmpl_name=m_pay_pick_payment_lt&amount=$_GET["amount"];¤cy=LTL">
The thing i need to do is i need to make a one page where the user enters the value and it directly redirects him into the page of payments. Later i'm gonna do that the user chooses one payment from a drop down menu and it redirects him directly to the instructions.
P.S. i'm kinda new in PHP.
Thanks for replys.