I am trying to login and then post to a site. I have my script successfully working on another form, but now this one (with file fields--only difference I can think of) gives me some problems. When I try to post to this site it gives me this error:
Server: www.site.com Server: 'www.site.com' Date / Time: 06/26/02 00:13:38 Browser: Mozilla/4.5 Error: ODBC Error Code = S1000 (General error) [Oracle][ODBC][Ora]ORA-00936: missing expression The error occurred while processing an element with a general identifi +er of (CFQUERY), occupying document position (394:3) to (394:60).
I don't understand why I am now getting this error. Do I need to set a content_type differently (but why would that affect what seems to be an issue with the database)? Any ideas? Here is what my code looks like:
#!/usr/lib/perl use strict; use warnings; use LWP::UserAgent; use HTTP::Request::Common; use HTTP::Cookies; use LWP::Simple; my $ua = LWP::UserAgent->new; $ua->cookie_jar(HTTP::Cookies->new(file => 'cookie_jar', autosave =>1) +); $ua->agent( "Mozilla/4.5" ); # do redirects after post push @{ $ua->requests_redirectable }, 'POST'; $ua->request(POST "http://www.site.com/login.cfm", { username =>"test", password =>"testabc", sid =>"$sid", submit =>"Submit" }); my $request = $ua->request(POST "http://www.site.com/editproduct.cfm", { name =>"test", version =>"1.1", prodnote =>"test", file =>'/docroot/filename.exe' product_ID =>"888999", session_id =>"3298220938434", update =>"Update" }); $b = $request->is_success ? "Worked\n" : "Error.\n"; my $a = $request->as_string; print $a;


Michael Jensen
michael at inshift.com
http://www.inshift.com

In reply to Causing an ODBC error in form post? by inblosam

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.