Need help - remote filling in forms :)

This forum is now closed as part of retiring phpBB2.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
Peter VDD
Registered User
Posts: 140
Joined: Sun Oct 12, 2003 12:18 pm
Contact:

Need help - remote filling in forms :)

Post by Peter VDD »

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! :)

Greetz, Peter
Last edited by Peter VDD on Tue Apr 10, 2007 4:21 pm, edited 1 time in total.
phulaeo
Registered User
Posts: 214
Joined: Tue Sep 07, 2004 12:35 am
Contact:

Post by phulaeo »

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

[ edit: method 3 would also entail changing the relative references to absolute, as the page still ends up on your site ]
Peter VDD
Registered User
Posts: 140
Joined: Sun Oct 12, 2003 12:18 pm
Contact:

Post by Peter VDD »

Method 1 fails.
Method 2 isn't possible, since the path is <a href="javascript:document.form1.submit();>
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. :)
markus_petrux
Former Team Member
Posts: 1887
Joined: Wed Apr 23, 2003 7:11 am
Location: Girona, Catalunya (Spain)
Contact:

Post by markus_petrux »

Peter VDD wrote: Method 2 isn't possible, since the path is <a href="javascript:document.form1.submit();>

This is because that page uses a link instead of an INPUT TYPE="submit" element. It has the same effect, though.
EasyMOD Standards | MOD Template Actions | MODs in Development Rules
Useful information for MOD Authors | MOD Queue Stats | Search MODs
Write SQL/DDL portable to all SQL servers supported by phpBB!
Get EasyMOD 0.3.0! | Suport al phpBB en Català!
8)
Peter VDD
Registered User
Posts: 140
Joined: Sun Oct 12, 2003 12:18 pm
Contact:

Post by Peter VDD »

markus_petrux wrote: 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? :)
markus_petrux
Former Team Member
Posts: 1887
Joined: Wed Apr 23, 2003 7:11 am
Location: Girona, Catalunya (Spain)
Contact:

Post by markus_petrux »

Have you contacted their webmaster?



.
EasyMOD Standards | MOD Template Actions | MODs in Development Rules
Useful information for MOD Authors | MOD Queue Stats | Search MODs
Write SQL/DDL portable to all SQL servers supported by phpBB!
Get EasyMOD 0.3.0! | Suport al phpBB en Català!
8)
Peter VDD
Registered User
Posts: 140
Joined: Sun Oct 12, 2003 12:18 pm
Contact:

Post by Peter VDD »

No... why would I need to contact their webmaster?
Last edited by Peter VDD on Tue Apr 10, 2007 4:32 pm, edited 1 time in total.
phulaeo
Registered User
Posts: 214
Joined: Tue Sep 07, 2004 12:35 am
Contact:

Post by phulaeo »

This is the actual form on their site:

Code: Select all

<form name="form1" method="post" action="AoPS_L_TeXer.php">
<p> 
<textarea name="textarea" cols="60" rows="5" wrap="VIRTUAL"></textarea>
</p>

<p> <a href="javascript:document.form1.submit();"><img src="Images/Submit.gif" width="100" height="24" border="0"></a> 
</p>
                 
</form>
They use javascript, but all you need is a form with a textarea by the same name. Point your form to the AoPS_L_TeXer.php location (use an absolute URL) from your site, add a submit button (just set its value to submit, I would guess) and this method will probably be your best bet.
markus_petrux
Former Team Member
Posts: 1887
Joined: Wed Apr 23, 2003 7:11 am
Location: Girona, Catalunya (Spain)
Contact:

Post by markus_petrux »

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.
EasyMOD Standards | MOD Template Actions | MODs in Development Rules
Useful information for MOD Authors | MOD Queue Stats | Search MODs
Write SQL/DDL portable to all SQL servers supported by phpBB!
Get EasyMOD 0.3.0! | Suport al phpBB en Català!
8)
Post Reply

Return to “[2.0.x] MOD Writers Discussion”