Avatar of robrodp
robrodp
Flag for Mexico asked on

PHP $_POST vs asp request

I run the rhe client program (a credit card processor)  and run simple scripts to return the values it posts
and PHP works.. not asp.

I have no access to the posting script/program

With php I use $_POST to retrieve the data

$reference_sale = $_POST["reference_sale"];
$reference_pol= $_POST["reference_pol"];
$value=$_POST["value"];

Great values are there

But in asp

reference_sale = request("reference_sale")
reference_pol= request("reference_pol")
value=request("value")

They all return an empty value (same with request.form and request.querystring)

I just call the client program (a credit card processor and run simple scripts to return the values
and PHP works.. not asp.

Now is ther a way to bring all the posted data in asp and parse it?

Or some other solution I tried to get the data with PHP and redirect it to the asp script (with GET) and it works fine when ran as standalone but in the client environment the values are lost

Thx

IPS  know php  $_POST and asp request are supposed to be fully equivalente but equivalent but it just doesn't work.

Any ideas?
ASP* Forms APIPHP

Avatar of undefined
Last Comment
robrodp

8/22/2022 - Mon
Julian Hansen

Works for me. How are you calling the ASP page.

ASP
<%
reference_sale = request("reference_sale")
reference_pol= request("reference_pol")
value=request("value")
Response.write "Reference Sale:" & reference_sale & "<br/> Reference Pol:" & reference_pol & "<br/>Value: " & value
%>

Open in new window

Code to call it
<script>
$(function() {
	$.ajax({
		url: 't2347.asp',
		data: {reference_sale: 'Sale',reference_pol: 'Pol', value: 24},
		type: 'POST'
	}).done(function(resp) {
		$('#result').html(resp);
	});
});
</script>

Open in new window

Working sample here
robrodp

ASKER
Thx

As I posted the  calling debelopment is a form

 <form name="payu" method="post" action="https://sandbox.gateway.payulatam.com/ppp-web-gateway/">

it has inputs and so forth

the asp I need is the lest line:

<input name="confirmationUrl"    type="hidden"  value="http://www.atletasmexico.com/demo/checkout.asp" >

There is where I cant request the variables with asp. With php (checkout.php) the variables are retrieved fine with $_POST

No idea who calls the asp or the php.

I have no control over the script that calls checkout.asp

Actually checkout with regular request  would be ok with:
<%
reference_sale = request("reference_sale")
reference_pol= request("reference_pol")
value=request("value")
%>

TYhe question is the php script receives the data from the unknown form... asp does not. Thats what I was wondering if I could call the complete post data and parse it.
ASKER CERTIFIED SOLUTION
hielo

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
robrodp

ASKER
Great approach. Thx
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck