×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Posting information to another CGI Script than reading it back

Posting information to another CGI Script than reading it back

Posting information to another CGI Script than reading it back

(OP)
I am new at Perl, I am trying to update an off the shelf e commerce solution to pass package information to the UPS web site, cgi program than read it back into the active CGI and update variables in my site.  Below is the html software that UPS gives as an example.

<body>
<FORM METHOD="POST" ACTION="http://www.ups.com/using/services/rave/qcost_dss.cgi";>
<INPUT TYPE="HIDDEN" NAME="AppVersion" VALUE="1.2">
<INPUT TYPE="HIDDEN" NAME="AcceptUPSLicenseAgreement" VALUE="Yes">
<INPUT TYPE="HIDDEN" NAME="ResponseType" VALUE="application/x-ups-rss">
<INPUT TYPE="HIDDEN" NAME="ActionCode" VALUE="3">
<INPUT TYPE="HIDDEN" NAME="ServiceLevelCode" VALUE="GND">
<INPUT TYPE="HIDDEN" NAME="RateChart" VALUE="Regular Daily Pickup">
<INPUT TYPE="HIDDEN" NAME="ShipperPostalCode" VALUE="97402 ">
<INPUT TYPE="HIDDEN" NAME="ConsigneePostalCode" VALUE="97301 ">
<INPUT TYPE="HIDDEN" NAME="ConsigneeCountry" VALUE="US">
<INPUT TYPE="HIDDEN" NAME="PackageActualWeight" VALUE=10>
<INPUT TYPE="HIDDEN" NAME="ResidentialInd" VALUE="O">
<INPUT TYPE="HIDDEN" NAME="PackagingType" VALUE="00">

<INPUT TYPE="SUBMIT" VALUE="CLICK HERE TO SEE SHIPPING OPTIONS BASED ON ESTIMATED WEIGHT">
</FORM>
</body>

</html>

Here is what I tried (please note I don't want to prompt the user to do anything I just want to pass the information than parse the http file that is returned and read it back and update my active variables.)

 $upssite = "http://www.ups.com/using/services/rave/qcost_dss.cgi";;
 $pkgstring = "AppVersion=1.2";
 $pkgstring .= "&AcceptUPSLicenseAgreement=yes";
 $pkgstring .= "&ResponseType=application/x-ups-rss";
 $pkgstring .= "&ActionCode=3";
 $pkgstring .= "&ServiceLevelCode=GND";
 $pkgstring .= "&RateChart=Regular Daily Pickup";
 $pkgstring .= "&ShipperPostalCode=97402";
 $pkgstring .= "&ConsigneePostalCode=" . $zip . "&";
 $pkgstring .= "ConsigneeCountry=" . $country . "&";
 $pkgstring .= "PackageActualWeight=1";
 $pkgstring .= "&ResidentialInd=0";
 $pkgstring .= "&PackagingType=00";

print "<tr><td>\"$pkgstring\"</td></tr>";
 
print "<tr><td>";

@ret = split( '%', get($upssite, $pkgString) );

read(STDIN, $buffer $ENV{'CONTENT_LENGTH'});
@upsdata = split(/%/, $buffer);

print "\"$upsdata[13]\"";

print "</tr></td>";

Please let me know, I am willing to pay a consulting fee if necessary.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close