Page 1 of 1
Need help - remote filling in forms :)
Posted: Tue Sep 07, 2004 1:11 pm
I have a question, I want to make a mod which allows to remotely fill in a field somewhere on another website, how should i do this? is there a command for it?
Thanks a lot!
Posted: Tue Sep 07, 2004 9:28 pm
Well, three ways immediately come to mind.
First off, you could try making a link to the form using ".../form.php?textarea=".urlencode("a=1\nb=2\nc=3\na + b - c"); or something similiar. If it fills it in the textbox, you have a winner; just depends on how the form is coded.
Second, you could try imitating the post on your site, i.e. copying their form code and changing the relative reference in ACTION="" to an absolute one, i.e. ACTION="form.php" becomes ACTION="http://remotesite.com/form.php
Third, and this would be my choice, because it involves text parsing (MAN I love text parsing!), you could create a script that takes input for that field on your site; on submit, it could open itself or another script in a new window which would grab that form page, parse it until it found the text field/textarea you want (<textarea name="textarea" cols="60" rows="5" wrap="VIRTUAL"></textarea>, in the example you sent), and insert the input from your original form right between those start/end textarea tags.
[ edit: method 3 would also entail changing the relative references to absolute, as the page still ends up on your site ]
Posted: Tue Sep 07, 2004 9:55 pm
Method 1 fails.
Method 3: I got no clue how to do that
could you give a simple example code? thanks
PS: if you could make the image render without the page loading, that's ok too. I know how the name of it gets rendered, so I can figure out the filename, and it is saved in a cache. In fact, that would even be easier.
Posted: Tue Sep 07, 2004 10:00 pm
Peter VDD wrote:
This is because that page uses a link instead of an INPUT TYPE="submit"
element. It has the same effect, though.
Posted: Tue Sep 07, 2004 10:06 pm
This is because that page uses a link instead of an INPUT TYPE="submit" element. It has the same effect, though.
Still that doesn't solve my question
How can I make the image render remotely, i.e. how can I make my site click the submit button automatically after typing the text in that window?
Posted: Tue Sep 07, 2004 10:13 pm
Have you contacted their webmaster?
Posted: Tue Sep 07, 2004 10:59 pm
No... why would I need to contact their webmaster?
Posted: Tue Sep 07, 2004 11:06 pm
This is the actual form on their site:
Code: Select all
<form name="form1" method="post" action="AoPS_L_TeXer.php">
<textarea name="textarea" cols="60" rows="5" wrap="VIRTUAL"></textarea>
Posted: Wed Sep 08, 2004 6:08 am
It can be done by posting the form via sockets and then parsing the result to extract the image URI.
Not all hosts support PHP sockets, though.