Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Posting information to another CGI Script than reading it back

Status
Not open for further replies.

JCioffi

Programmer
Apr 30, 2000
1
US
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.&nbsp;&nbsp;Below is the html software that UPS gives as an example.<br><br>&lt;body&gt;<br>&lt;FORM METHOD=&quot;POST&quot; ACTION=&quot;<A HREF=" TARGET="_new"> TYPE=&quot;HIDDEN&quot; NAME=&quot;AppVersion&quot; VALUE=&quot;1.2&quot;&gt;<br>&lt;INPUT TYPE=&quot;HIDDEN&quot; NAME=&quot;AcceptUPSLicenseAgreement&quot; VALUE=&quot;Yes&quot;&gt;<br>&lt;INPUT TYPE=&quot;HIDDEN&quot; NAME=&quot;ResponseType&quot; VALUE=&quot;application/x-ups-rss&quot;&gt;<br>&lt;INPUT TYPE=&quot;HIDDEN&quot; NAME=&quot;ActionCode&quot; VALUE=&quot;3&quot;&gt;<br>&lt;INPUT TYPE=&quot;HIDDEN&quot; NAME=&quot;ServiceLevelCode&quot; VALUE=&quot;GND&quot;&gt;<br>&lt;INPUT TYPE=&quot;HIDDEN&quot; NAME=&quot;RateChart&quot; VALUE=&quot;Regular Daily Pickup&quot;&gt;<br>&lt;INPUT TYPE=&quot;HIDDEN&quot; NAME=&quot;ShipperPostalCode&quot; VALUE=&quot;97402 &quot;&gt;<br>&lt;INPUT TYPE=&quot;HIDDEN&quot; NAME=&quot;ConsigneePostalCode&quot; VALUE=&quot;97301 &quot;&gt;<br>&lt;INPUT TYPE=&quot;HIDDEN&quot; NAME=&quot;ConsigneeCountry&quot; VALUE=&quot;US&quot;&gt;<br>&lt;INPUT TYPE=&quot;HIDDEN&quot; NAME=&quot;PackageActualWeight&quot; VALUE=10&gt;<br>&lt;INPUT TYPE=&quot;HIDDEN&quot; NAME=&quot;ResidentialInd&quot; VALUE=&quot;O&quot;&gt;<br>&lt;INPUT TYPE=&quot;HIDDEN&quot; NAME=&quot;PackagingType&quot; VALUE=&quot;00&quot;&gt;<br><br>&lt;INPUT TYPE=&quot;SUBMIT&quot; VALUE=&quot;CLICK HERE TO SEE SHIPPING OPTIONS BASED ON ESTIMATED WEIGHT&quot;&gt;<br>&lt;/FORM&gt;<br>&lt;/body&gt;<br><br>&lt;/html&gt;<br><br>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.)<br><br>&nbsp;$upssite = &quot;<A HREF=" TARGET="_new"> = &quot;AppVersion=1.2&quot;;<br>&nbsp;$pkgstring .= &quot;&AcceptUPSLicenseAgreement=yes&quot;;<br>&nbsp;$pkgstring .= &quot;&ResponseType=application/x-ups-rss&quot;;<br>&nbsp;$pkgstring .= &quot;&ActionCode=3&quot;;<br>&nbsp;$pkgstring .= &quot;&ServiceLevelCode=GND&quot;;<br>&nbsp;$pkgstring .= &quot;&RateChart=Regular Daily Pickup&quot;;<br>&nbsp;$pkgstring .= &quot;&ShipperPostalCode=97402&quot;;<br>&nbsp;$pkgstring .= &quot;&ConsigneePostalCode=&quot; . $zip . &quot;&&quot;;<br>&nbsp;$pkgstring .= &quot;ConsigneeCountry=&quot; . $country . &quot;&&quot;;<br>&nbsp;$pkgstring .= &quot;PackageActualWeight=1&quot;;<br>&nbsp;$pkgstring .= &quot;&ResidentialInd=0&quot;;<br>&nbsp;$pkgstring .= &quot;&PackagingType=00&quot;;<br><br>print &quot;&lt;tr&gt;&lt;td&gt;\&quot;$pkgstring\&quot;&lt;/td&gt;&lt;/tr&gt;&quot;;<br>&nbsp;<br>print &quot;&lt;tr&gt;&lt;td&gt;&quot;;<br><br>@ret = split( '%', get($upssite, $pkgString) );<br><br>read(STDIN, $buffer $ENV{'CONTENT_LENGTH'});<br>@upsdata = split(/%/, $buffer);<br><br>print &quot;\&quot;$upsdata[13]\&quot;&quot;;<br><br>print &quot;&lt;/tr&gt;&lt;/td&gt;&quot;;<br><br>Please let me know, I am willing to pay a consulting fee if necessary.<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top