Solved

What does a browser send to the server on a GET/POST?

Posted on 1997-05-29
5
148 Views
Last Modified: 2013-12-25
Hi,

I am trying to write a perl script to interact with a cgi-script on another server. I need to POST a form (of which I know the fields) to a www-server and also combined with GET...

Now I tried the perl LWP::UserAgent library which allows me to POST a message. After filling all the fields in, I get and ID error back from the web-server. What is missing... basically I submit the URL and the parameters, as would the web-server do. The script seems to check where the call came from. If I submit directly from the web-page it's o.k. however, if I save the form to a local drive, change the form a bit to include the URL and then submit, I get an ID error. Anything I can do to fool the receiving script. Note, I am not trying to hack a server, just trying to get some SMS messaging going to my handphone as the provider only supports Web-input.

Thanks for any feedback.
0
Comment
Question by:walterk
  • 3
  • 2
5 Comments
 

Author Comment

by:walterk
ID: 1828122
Adjusted points to 40
0
 

Author Comment

by:walterk
ID: 1828123
Edited text of question
0
 
LVL 5

Accepted Solution

by:
icd earned 40 total points
ID: 1828124
I suspect that the script running on the other server is using the HTTP_REFERRER environment variable to check if the form has been submitted from an 'approved' server. Since your script is running on another server which is not 'approved' then it objects to it.

I was about to say that you should try MSIE as your browser which has a bug in this variable but having tested it it seems that the bug is only with javascript and the environment variable is set correctly. Still it might be worth trying if you do not already use MSIE.

Failing that there is nothing you can do other than to pursuade the webmaster of the site to include your host on the list of 'approved' sites.

0
 

Author Comment

by:walterk
ID: 1828125
Thanks Icd,

Isn't there a way to also submit the HTTP_REFERRER using the LWP library, since the browser also gets this information ?
0
 
LVL 5

Expert Comment

by:icd
ID: 1828126
Sorry, I have never used the LWP library.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question