Ok, just to clear this up for everyone. I just need this when the form posts basically. This will be used in conjuction LinkPoint for payment information. And again, I really appreciate all the help. I'm not very good in php and I have a massive under taking here.
Well, I tried it and still no luck. I'm going to include all the code from this page to see if maybe this helps. I'm getting pretty depeserate to get this working.
Code:
<?
session_start();
include('global.php');
/********************************************/
//Place your ecommerce code here
if($_SESSION['MemberPass'] != 'guestpass'){
//Connect to your merchant gateway and process Transaction
$purchaseApproved = true;//used down below
$amount = '20.00'; //$20.00 used down below
}
/********************************************/
//connect to streamserver gateway and update member balance
//if member doesn't exist in our database then create him
if($purchaseApproved){
//******* check if member exists first
if(!$_SESSION['member_exists']){
$params = '&action=user_info_request&account_id='.$_SESSION['account_id'].'&gateway_pass='.$_SESSION['gateway_pass'];
$params .= '&user='.$_SESSION['member_user'];
$result = sendPost($_SESSION['gateway_ip'],$params,true);//use ssl
//****** member doesn't exist so create him
if(strstr($result['message'],'error:Username Not Found')){
$params = '&action=user_create&account_id='.$_SESSION['account_id'].'&gateway_pass='.$_SESSION['gateway_pass'];
$params .= '&user='.$_SESSION['member_user'].'&pass='.$_SESSION['member_pass'];
$result = sendPost($_SESSION['gateway_ip'],$params,true); //use ssl
if(strstr($result['message'],'ok:User Created')){//member created
$_SESSION['member_exists'] = true;
}
}else if($result['user'] == $_SESSION['member_user']){//member already exists
$_SESSION['member_exists'] = true;
}
}
//******member exists now update balance
if($_SESSION['member_exists']){
$params = '&action=user_update&account_id='.$_SESSION['account_id'].'&gateway_pass='.$_SESSION['gateway_pass'];
$params .= '&user='.$_SESSION['member_user'];
$params .= '&add_amount='.$amount;
$result = sendPost($_SESSION['gateway_ip'],$params,true); //use ssl
//******* update amount was good, now read back member balance and display
if(strstr($result['message'],'ok:')){
$params = '&action=user_info_request&account_id='.$_SESSION['account_id'].'&gateway_pass='.$_SESSION['gateway_pass'];
$params .= '&user='.$_SESSION['member_user'];
$result = sendPost($_SESSION['gateway_ip'],$params,true); //use ssl
if($result['balance']){
$message = 'Your New Balance is $'.$result['balance'];
}else{
$message = 'Error Reading Back Your Balance, contact Customer Support';
}
}
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>....//cut to fit
<body>
<div id="container">
<div align="center"><img src="../../concept/top-bar.gif" width="800" height="16"></div>
<div align="center"><table width="800" bgcolor="#FFFFFF">
<tr>
<td width="81" class="style3"><a href="home.html">Home</a></td><td width="47"><img src="../../concept/star.gif" width="19" height="19"></td>
<td width="146" class="style3"><a href="rio.html">Rio De Janerio</a></td><td width="54"><img src="../../concept/star.gif" width="19" height="19"></td>
<td width="130" class="style3"><a href="camarea/index.php">Members</a></td>
<td width="54"><img src="../../concept/star.gif" width="19" height="19"></td>
<td width="121" class="style3"><a href="contest.html">Contests</a></td>
<td width="65"><img src="../../concept/star.gif" width="19" height="19"></td>
<td width="62" class="style3"><a href="catalog/index.php">Store</a></td>
</tr>
</table></div>
<div align="center"><img src="../../concept/header.gif" width="799" height="211"></div>
<script>
function formatCurrency(num) {
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3));
return (((sign)?'':'-') + '$' + num + '.' + cents);
}
function a(){
document.cart.chargetotal.value = document.cart.cost_total.value; }
</script>
<FORM action="https://www.linkpointcentral.com/lpc/servlet/lppay" method="post" name="cart">
<input type="hidden" name="storename" value="996471">
<INPUT type="hidden" name="chargetotal" value="<? echo $_POST['cost_total']; ?>">
<input type="hidden" name="mode" value="payplus">
<table align=center width=500 cellpadding=0 cellspacing=0>....
I've highlighted the items that are passed to the gateway. The issue is that it doesn't like the value that is passed for the cost_total. If I put in a static value like 5.00, it works fine. So, there must be a issues with the format of the value or either nothing is getting passed.
I understand Heavy Metal's point, but no matter what browser you view the page in, the source is never going to show the PHP code. It doesn't matter if the browser is running on the server or on the local machine, it's never going to happen. Whenever a PHP request is made, the file always goes to the server's PHP processor. An HTML document is sent back. Now, I suppose, the server's PHP processor could be considered a client, but not really.
"I have no special talent. I am only passionately curious." — Albert Einstein
Bookmarks