I have used this script to post information on a unix based site and it worked perfect, now that im running it at home on win xp professional using activeperl 5.8 the query string doesnt seem to work right. What is different or what do I need to change in the script to work on winxp platform the same? Im getting the page response in the browser but the SITE being fetched is stating IM NOT sending any of the information (i.e. posted query string info). IT IS NOT a server error 500 , it is just the info not going thru.
some of the script here:
#!c:/Perl/bin/perl use CGI; use HTTP::Headers; use HTTP::Request; use LWP::UserAgent; $q = new CGI; $blankthing = ""; #set inital $pictureurl = $q->param('pictureurl'); $picturedesback = $q->param('picturedes') || $blankthing; #put into va +r $picturedes = $picturedesback; $picturedes2 = $picturedesback; $altpicturedes = substr($picturedes2, 0,39);# = ""; #cut off after 79 + charactors $bannerurl = "http://www.blah.com/banner.gif"; $siteurl = "http://www.blah.com/"; $bannertext = "blah"; $email = "webmaster\@blah.com"; $reclink = 'http://www.blah.com/'; $counterthing = $q->param('whatsite'); $beginpicurl = "www.blah.com"; if ($counterthing eq 1) { $counterthing = $counterthing + 1; $posttourl = "http://www.blah.com"; $refererurl = "http://www.blah.com"; $beginpicurl = "www.blah.com"; $q = new CGI( { PictureURL=>"http://". $beginpicurl . "/" . $pictureurl, PictureDescription =>$picturedes, BannerURL=>$bannerurl, SiteURL=>$siteurl, BannerText=>$bannertext, Email=>$email, Reciprocal=>$reclink, action=>"SendNow", }); &dothething; } elsif ($counterthing eq 2) { $counterthing = $counterthing + 1; $posttourl = "http://blah.com"; $refererurl = "http://blah.com"; $q = new CGI( { purl=>"http://$beginpicurl/$pictureurl", desc =>$picturedes, surl=>$siteurl, burl=>$bannerurl, fnct=>"add_account", }); &dothething; } elsif($counterthing eq 3) { print $q->header; print "all done click back"; exit; } else{ print $q->header; print "ERROR"; } sub dothething { $formdata = $q->query_string; $h = new HTTP::Headers( Accept=>'text/html, text/plain, image/*', Referer=> $refererurl, Content_Type=>'application/x-www-form-urlencoded', Content_Base=>$posttourl, User_Agent=>"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Win 9x + 4.90)", ); $req = new HTTP::Request( POST, $posttourl, $h ); $req->content_type('application/x-www-form-urlencoded'); $req->content($formdata); $ua = new LWP::UserAgent( agent=>"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Win 9x 4.90 +)", ); $response = $ua->request($req); $JSCRIPT=<<END; function nexturl() { window.parent.location = "http://blah.com/"; } setTimeout("nexturl()", 15000); END print $q->header; print $q->start_html(-script=>$JSCRIPT); print "<BASE href=$posttourl>"; print $response->content; #print $q->end_html; }

20060130 Janitored by Corion: Added <readmore> tag

20060131 Edited by planetscape - removed spurious whitespace


In reply to script help (worked well on unix but NOT on winxp) newbie by stevelake

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.