Jump to content

[SOLVED] Help Please...Postback question---suggestions please!!!


macii2508

Recommended Posts

Ok...I am new to the shopping care online processing world. Here's the deal...From my website you can register for a webinar when you click the link it takes you to a third party shopping cart which is imbeaded in a frame on my site. It updates the cart with the item and then the end user posts their data (cc and other info). Then if processing is good they will be redirected to the registration page of the web conferencing site via the Approved Url link I set up in the 3rd party payment system. This all works fine untill you add another product for the customer to purchace which when purchaced they will need to be redirected to a different link.... the third party payment system will only let me re-direct to one Url on approved processing. So the folks at the payment gateway told me I need to utilize a post back script in which they will send information to a url (mysite.com/script?) with the details of the transaction of the transaction...order#,prod_ID..etc and with this I can send back a specific link to be shown to the end user for the product they oredered??? Make sense? Can I accomplish this with php? or do I need to use a cgi script? everywhere I look online people are using .asp to acomplish this.. my site runs on apache/php/mysql on linux server. Can someone point me in the right direction.

Thanks.

Link to comment
Share on other sites

I assume they mean they send data back to your site using GET. This would be a URL like: mysite.com/script.php?var=val&va2=val2. All you have to do is use the $_GET array inside your script.php file to send their data. In the example, $_GET['var'] would contain "val".

Link to comment
Share on other sites

Ok...well I have a pdf the sent me with all of the fields they send...I guess my question is how do I turn that string of data into something the script will understand fo instance if I tell turn the function on and have them send it to mysite.com/script.php and they send one big glob of data...how will the script be able to handle the glob of data it could be field1field2field3field3...etc how will the script know where field2 is in the string they send? Im sorry if im being ignorant...Is there a way I can turn on the function and have it written to a txt file to see how the date is coming in to my server?

Link to comment
Share on other sites

Ok...I understand about var=val&va2=val2.....but they are just asking for a straight url in their example they show mysite.com/script.asp although Im trying to do this with php. I have created my code using the field names they are passing back. see below.

But when I test this live not using the mysite.com/script.php?P_part1=val&etc.... rather just them just posting back to mysite.com/script.php I does not function properly. Im assuming this method wont work with php if they cant send the var=val&va1=val portion in the url.. Im guessing .asp can handle this? Any information would be great. The only other thing I can guess is that I have the code right and they just are passing any vars back.

 

<?php
// Gets the product Id and the Name and email and then posts the proper link


        $string1 = strtolower($_GET['P_part1']);
        $string2 = strtolower($_GET['C_name']);
        $string3 = strtolower($_GET['C_email']);

        if (strpos($string1,'apsw082207') > -1) {
	$is_prod = 'http://www.site1.com/event.asp?id=42057';
}
         elseif (strpos($string1,'apsw092607') > -1) {
	$is_prod = 'http://site2.com/example.html';
} 
         else {
	$is_prod = 'sorry';
}
echo '
         <p>Hello <strong>' . $string2 . '</strong></p>	
         <p><a href=' . $is_prod . '>Click here to continue registration</a></p>
         <p>Your <strong>' . $string3 . '</strong> has been recorded. Thanks</p>
';
?>

Link to comment
Share on other sites

lemmin thanks for your help...im sure I am annoying you by now.. here is the example they give if I were going to be using .asp code.

 

<%
'Post Back Services Sample Handler Script
'=======================================================
'This sample extracts the elements returned via the Post
'Back Service and Logs them to a Local File
'=======================================================
Set fileobject = CreateObject("Scripting.FileSystemObject")
Set log_file = fileobject.OpenTextFile("C:\postback.txt",8,True)
log_file.Write "-------------------------------------------------------------------" & vbCrLf
log_file.Write Now() & vbcrlf
for i = 1 to Request.Form.Count
log_file.Write Request.Form.Key(i) & " = " & Request.Form.Item(i) & vbcrlf
next
log_file.Write "-------------------------------------------------------------------" & vbCrLf
log_file.close
%>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.