Jump to content

making script for signing guesbook


Recommended Posts

ive made an site with siteman and i want to make an prgramm that post something to the guesbook but this form has No name and the massage is not an input but an textarea look

<tr><td><b>Please sign my guestbook!<b><br /><form action="guestbook.php?do=addpost" method="post"><table cellspacing="0" cellpadding="2" width="100%"><tbody><tr><td width="20%">Your name</td><td width="80%"><input size="30" name="guestfield[1]" /></td></tr><tr><td>Location</td><td><input size="30" name="guestfield[2]" /></td></tr><tr><td>Website (Must begin with http://)</td><td><input size="30" name="guestfield[3]" /></td></tr><tr><td>Message</td><td><textarea name="guestfield[4]" rows="5" cols="50" /></textarea></td></tr><tr><td colspan="2"><input type="submit" value="Post My Message" /></td></tr></tbody></table></form><br /><b><u>Previous posts:</u></b><br /></b></b></td></tr></table><table cellspacing="0" cellpadding="3"><tr><td> :: </td><td><b>1</b></td><td> :: </td></tr></table>        
    <table cellspacing="0" cellpadding="3" width="100%"><tr><td width="100%"><table cellspacing="0" cellpadding="3" width="100%"><tbody><tr><td class="g" valign="middle" align="center" width="20%">Name: Siteman<br />Location: Norway<br /><a class="g" href="http://sitem.sourceforge.net" target="_blank">Website</a><br />IP: <i>N/A</i></td><td valign="top">Welcome to siteman - the easiest to use Content Management System ever created!<br /><br /><hr /><small><div align="right">Posted on the 28.03.03 22.16</div></small></td></tr></tbody></table></td></tr></table><br /><table cellspacing="0" cellpadding="3"><tr><td> :: </td><td><b>1</b></td><td> :: </td></tr></table><!-- Content end --></td></tr>

</table></td></tr>

sow ive tried to make

$oIE = _IECreate() 
_IENavigate($oIE, "http://members.lycos.nl/djmatthy/siteman/guestbook.php")

;$Ei = _IEFormGetCount($oIE)
;MsgBox(4096, "Test", $Ei , 10)

Sleep(1000)


$o_Text = _IEFormGetObjByName($oIE, "guestfield[4]")


; Set field values and submit the form
_IEFormElementSetValue($o_Text, "this is an test")

Sleep(2000)

;_IEFormSubmit($o_form)

Sleep(3000)

the site is http://members.lycos.nl/djmatthy/siteman/guestbook.php to see how its build

ive also tried get _IEFormGetObjByIndex() but he doesnt seem to find it then ether :D

Link to comment
Share on other sites

atleast you tryed

#include <IE.au3>
$IE = _IECreate("http://members.lycos.nl/djmatthy/siteman/guestbook.php")
_IELoadWait($IE)
$form = _IEFormGetObjByIndex($IE,2)
$name = _IEFormElementGetObjByName($form,"guestfield[1]")
$Location = _IEFormElementGetObjByName($form,"guestfield[2]")
$website = _IEFormElementGetObjByName($form,"guestfield[3]")
$Message = _IEFormElementGetObjByName($form,"guestfield[4]")
_IEFormElementSetValue($name,"Your Name")
_IEFormElementSetValue($Location,"Your Location")
_IEFormElementSetValue($website,"http://www.google.com")
_IEFormElementSetValue($Message,"Your Message")
_IEFormSubmit($form)
Link to comment
Share on other sites

atleast you tryed

#include <IE.au3>
$IE = _IECreate("http://members.lycos.nl/djmatthy/siteman/guestbook.php")
_IELoadWait($IE)
$form = _IEFormGetObjByIndex($IE,2)
$name = _IEFormElementGetObjByName($form,"guestfield[1]")
$Location = _IEFormElementGetObjByName($form,"guestfield[2]")
$website = _IEFormElementGetObjByName($form,"guestfield[3]")
$Message = _IEFormElementGetObjByName($form,"guestfield[4]")
_IEFormElementSetValue($name,"Your Name")
_IEFormElementSetValue($Location,"Your Location")
_IEFormElementSetValue($website,"http://www.google.com")
_IEFormElementSetValue($Message,"Your Message")
_IEFormSubmit($form)
hehe youre an genius still i dont get it i already tried it this way :D

but it doesnt matter if it is an text area an input or what :D

well learned something again then

thanx man

Edited by Matthy
Link to comment
Share on other sites

i dont get it first when i tried it i worked an now i am getting the error

C:\Program Files\SciTE\autoit\autoit\Guestbook\IE.au3 (848) : ==> Variable must be of type "Object".:

how can that come first it worked :D

sorry already got it it has to do whith when you logged in and when you dont :D

Edited by Matthy
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...