Link to home
Start Free TrialLog in
Avatar of Adam409
Adam409

asked on

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
Avatar of Zyloch
Zyloch
Flag of United States of America image

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
Avatar of Adam409
Adam409

ASKER

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
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
Avatar of Adam409

ASKER

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
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.
To clarify, you can make it with a web language (Perl CGI is what I mean)
SOLUTION
Avatar of poopall
poopall

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Adam409

ASKER

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
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
%>
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I hear what you are saying, but you dont control the other website, so what is your solution ?
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 ..

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.
Avatar of Adam409

ASKER

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
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 ..