• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 257
  • Last Modified:

Automatically fill in a form fields after a form has been submitted.

What i'm trying to do is fill in a form on another website after a form has been filled out and submitted on my own website.  I do not have access to the source code of the remote website so i hope that won't stop me.  I put this in the general web language section because i didn't know which language i would need to use exactly.  I'm not even sure if i should be using a web language.  Any suggestion would be most appreciated and an example would be helpful if this can be done.

If anyone needs more detail on what i'm trying to do exactly i can get more specific.

Thanks in Advance.
Adam
0
Adam409
Asked:
Adam409
  • 4
  • 4
  • 4
  • +2
3 Solutions
 
ZylochCommented:
Hi

I must say this would be a bit difficult with a web language. I'm familiar with PHP and you could probably stretch it a bit to make it work, but I would recommend getting a copy of Perl, learning some basic syntax, and posting in that area (particularly inquire about LWP::UserAgent

Others may be able to stretch web languages to make it work, and I can try with PHP if you want me to... (Of course, with almost any language, there lies the problem of finding out when a form is being submitted on your site. The problem of this lies in the fact that you can constantly query your web server, but that would waste bandwidth. I believe there are programs out there that can automate things for you, if you want them)

Regards,
Zyloch
0
 
Adam409Author Commented:
Thanks Zylochs

I do have some Basic Perl Experience... you think that would be the best solution??? If so i will post it there right now.

Adam
0
 
ZylochCommented:
Well, Perl has great data manipulation and may be the EASIEST solution. The biggest problem lies in the fact of how to know that the user has submitted a form on your website
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Adam409Author Commented:
Well i think i should expain exactly what i'm trying to do to give you a better idea.

On my website i have clients that use my management system to put up products for sale.  What clients have asked me is if they could use my system to put up products for my site as well as one of my competitors websites that they use as well.  So what needs to be done is when they put an item up on my website they want it to automatically fill in the appropriate fields on my competitors site and submit that as well.  Basically manage 2 systems from one spot.  Obviously being my competitor i don't have access to there source code.  Just my clients management system for my competitor.

Hopefully this make sense and if more clarification needs to be done i am more then willing to provide that information.

Adam
0
 
ZylochCommented:
I think I see what needs to be done. Ideally, you'd have it in the webpage code. The concept is pretty simple. It depends on what language you feel is best. Personally, I feel Perl would be pretty easy (but it may be possible easily in other languages too), because I know you can use LWP::UserAgent to post stuff.
0
 
ZylochCommented:
To clarify, you can make it with a web language (Perl CGI is what I mean)
0
 
poopallCommented:
I would use something like ASPTear, which is a free componet, in which you could collect the data on your webiste and then submit it to the other website, as if you had completed it your self. This can also be done by looking betwewn the <form> tags on the other website to see what input fields are being used, and then submitting the data from your web site directly using the date that is required. This assumes that you are not required to view the data on the form onn the other website

Example would be like submitting a query to google lookig for "ASP Tear"

http://www.google.com.au/search?q=asptear&ie=UTF-8&hl=en&meta=


Notice how q=asptear, you would insert this bit and then submit the http requests.

If you dont want to be redirect to or display googles website then use the ASPTear Compenent else just use the link above, but making the changes tht you require






0
 
waygoodCommented:
Have you thought about using the php CURL functions

QUOTE
PHP supports libcurl, a library created by Daniel Stenberg, that allows you to connect and communicate to many different types of servers with many different types of protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this can also be done with PHP's ftp extension), HTTP form based upload, proxies, cookies, and user+password authentication.
0
 
Adam409Author Commented:
I like both the ASPTear and the PHP CURL solutions.  I do have alot more experience with PHP then i do ASP but that isn't a factor really,  just what is best to use.

If anyone had an example using ASPTear or PHP CURL to autofill a form on a remote server based on a form that was submitted on there own that would be ideal just so i could see what is involved with either solution.

Thanks again for all the great ideas.

Adam
0
 
poopallCommented:
AspTear examples see

http://www.4guysfromrolla.com/webtech/071800-1.shtml

Or you can use XMLHTTP, alrady built into Intertnet Explorer see example below:-



Dim objXMLHTTP, xml
  ' Create an xmlhttp object:
   xml = Server.CreateObject("Microsoft.XMLHTTP")

  ' Version 3.0 of XMLHTTP, use:
  ' Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP")

  ' Opens the connection to the remote server.
  xml.Open ("GET", "http://www.google.com/search?q=web+services", False)      
  ' Actually Sends the request and returns the data:
  xml.Send
  'Display the HTML and Text
  'Response.Write ("<h1>The HTML text</h1><xmp>")
  'Response.Write (xml.responseText)
  'Response.Write ("</xmp>")
Response.Write ("<h1>This is generated results from google using XMLHTTP </h1>")
Response.Write (xml.responseText)
 xml = Nothing
%>
0
 
RejojohnyCommented:
the above code assumes that the page which u r submitting too accepts form values in querystring format .. so it works .. how does ur competitors page work .. i assume .. it must be a normal HTML page with lots of textboxes ... and a submt button .. just check when the submit button is clicked where does the page get sumitted to and is it done in the "GET" format (i.e. r the values seen in the querystring) and not form "POST" ..

the problems with the solution that ur thinking of is that if the other page changes for some reason .. u will have to keep changing ur code ..
0
 
poopallCommented:
I hear what you are saying, but you dont control the other website, so what is your solution ?
0
 
RejojohnyCommented:
one way of doing what he requires is to create a frameset ...
<frameset id="BodyFrameset" rows="30,*" frameborder="0" framespacing="0">
    <frame id="TopHeader" name="TopHeader" src="MyPage.asp" scrolling="no" noresize>
    <frame name="main" src="PageToBeAccessed.asp" frameBorder="no" scrolling="auto">
</frameset>

In the page MyPage.asp .. u could access all the variables of PageToBeaccessed.asp using client side scripting .. assign the required values this way and submit that form by calling the click event of the submit button ..

0
 
poopallCommented:
Your solution assumes that you don't mind seeing the contents of the other page, I was assuming that the purpose of this solution was to be somewhat stealthy,  even in your example with client side scripting assumes no changes to the other parties website, like change of variable names etc, etc.
0
 
Adam409Author Commented:
I would like to thank all the people that have sent replies.

I really like the curl approach because i am a better PHP programmer... if someone has some example code using curl other then the stuff that is on the php.net site that is related to what i'm trying to do that could possible help that would be most appreciated.

Thanks again

Adam
0
 
RejojohnyCommented:
poopall,
the same assumption of problems with changes in variable names etc. is true in ur suggestion too .. the one using XMLHTTP .. I only suggested this as an alternative when the form accepts inputs as a "POST" instead of "GET"

Adam409
To get a better solution as per ur requirement, U should move this question to a PHP aread or better close this question and start a new one in that area ..
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
  • 4
  • 4
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now