Jump to content

_IE Action not working


Recommended Posts

Hello, I believe I have come across a bug in the _IE library. I am trying to make a script that will automatically fill's in data for a restore script for a WP site. It's called Importbuddy by IThemes and it is one of the best, if not the best, backup restore plugins for WordPress. The problem that I am having is once it is on the first step of the script, filling in the password and clicking next, it redirects me to the index.php file and when I keep trying to return to the importbuddy.php file, it keeps redirecting back to the index file. Here is the code I am using, 

_$o = _IECreate() 
_IENavigate($o, [url of ImportBuddy]) 
_IELoadWait($o, 2000)
$step0 = _IEGetObjByName($o, "password");Password feild
_IEFormElementSetValue($step0, "pass");Password of Importbuddy
$Step0submit = _IEGetObjByName($o, "submit") 
_IEAction($Step0submit, "click") 
_IELoadWait($o, 2000)
;Goes to index.html, not the next step of the importbuddy

Here is a link to the importbuddy.php file,   http://bit.ly/1H9YZNb

Please only use this file for testing, it is part of a commercial product by IThemes 

To keep this simple, just install a program like XAMPP to view the file. Also, the password is "pass"

Does anyone have any ideas why this isn't working? 

As always, Thanks for your help 

Thomas 

Edited by onlineth

online.png?theme=dark profile for Tom on Stack Exchange, a network of free, community-driven Q&A sites 

scientia potentia est

Link to comment
Share on other sites

ok, I think I am going to take a different route on this. First I tried using the _IEFormSubmit but I keep getting an error of "2 ($_IEStatus_COMError) - COM Error in Object reference"

$o = _IECreate()
_IENavigate($o, "http://test.onlineth.x10host.com/importbuddy.php")
_IELoadWait($o, 2000)
$step0 = _IEGetObjByName($o, "password")
$form = _IEFormGetCollection($o, 0)
_IEFormElementSetValue($step0, "pass")
_IEFormSubmit($form)

So then I tried using the IE extended library but I can't get that to work either. Here is what I have for that,

$o = _IECreate()
_IENavigate($o, "http://test.onlineth.x10host.com/importbuddy.php")
_IELoadWait($o, 2000)
$step0 = _IEGetObjByName($o, "password")
$form = _IEFormGetCollection($o, 0)
_IEFormElementSetValue($step0, "pass")
$step0name = _IEGetObjByName($o, "submit")
_IEEx_JSMouseEventObjByName($o, $step0name, "mouseclick")
_IELoadWait($o, 2000)
I keep getting a "7 = No Match" error for that. I am running IE11

Also, the password for the http://test.onlineth.x10host.com/importbuddy.php is not "pass" but an extremely long string so no one will be albe to install anything malicious, it's just there so you can click on the button. If you click on it you should see this message, "Invalid password. Please enter the password you provided within BackupBuddy Settings. Attempt #."

Again, thanks for your help :)

online.png?theme=dark profile for Tom on Stack Exchange, a network of free, community-driven Q&A sites 

scientia potentia est

Link to comment
Share on other sites

 

Appears to work if you drop _IEFormSubmit and use _IEAction instead:

;_IEFormSubmit($form)
$btnSubmit = _IEGetObjByName($o, "submit")
_IEAction($btnSubmit, 'click')

Yes, but the issue is when I use _IEAction and "click", it redirects me to the index.html page (when I use the correct password) and when I try to navigate back to the /importbuddy.php it keeps redirecting back to the index.html file. If you can, put  the importbuddy.php file,  http://bit.ly/1H9YZNb, on a server and when you use the correct password(pass), you will see what I'm talking about. 

online.png?theme=dark profile for Tom on Stack Exchange, a network of free, community-driven Q&A sites 

scientia potentia est

Link to comment
Share on other sites

Sounds like a configuration issue.  What happens if you manually click the button? 

It goes to the next step without any problems

EDIT

That's why I was exploring the other ways to see if that would work

Edited by onlineth

online.png?theme=dark profile for Tom on Stack Exchange, a network of free, community-driven Q&A sites 

scientia potentia est

Link to comment
Share on other sites

Not in my testing. Even if I manually enter the password, it initially displays the index. If I then go back and refresh the php page, it goes to the desired web page.

Hmm, again, I am using this script,

$o = _IECreate()
_IENavigate($o, "http://test.onlineth.x10host.com/importbuddy.php")
_IELoadWait($o, 2000)
$step0 = _IEGetObjByName($o, "password")
$form = _IEFormGetCollection($o, 0)
_IEFormElementSetValue($step0, "pass")
$step0name = _IEGetObjByName($o, "submit")
;_IEEx_JSMouseEventObjByName($o, $step0name, "mouseclick")
$btnSubmit = _IEGetObjByName($o, "submit")
_IEAction($btnSubmit, 'click')
_IELoadWait($o, 2000)
_IENavigate($o, "http://test.onlineth.x10host.com/importbuddy.php")

However when I use the _IENavigate it does nothing. Also, I added _IEQuit which also does nothing. What version of IE are you running? I'm only asking this because I've been reading about alternatives and it seems that the update from IE10 to 11 seems to have caused much conflict (I'm running IE11). Also, do you know why the other scripts I made don't work?

Thanks for help on this:)

online.png?theme=dark profile for Tom on Stack Exchange, a network of free, community-driven Q&A sites 

scientia potentia est

Link to comment
Share on other sites

Does anyone know why the other scripts I have created don't work?

$o = _IECreate()
_IENavigate($o, "http://test.onlineth.x10host.com/importbuddy.php")
_IELoadWait($o, 2000)
$step0 = _IEGetObjByName($o, "password")
$form = _IEFormGetCollection($o, 0)
_IEFormElementSetValue($step0, "pass")
_IEFormSubmit($form) 
$o = _IECreate()
_IENavigate($o, "http://test.onlineth.x10host.com/importbuddy.php")
_IELoadWait($o, 2000)
$step0 = _IEGetObjByName($o, "password")
$form = _IEFormGetCollection($o, 0)
_IEFormElementSetValue($step0, "pass")
$step0name = _IEGetObjByName($o, "submit")
_IEEx_JSMouseEventObjByName($o, $step0name, "mouseclick")
_IELoadWait($o, 2000)
Edited by onlineth

online.png?theme=dark profile for Tom on Stack Exchange, a network of free, community-driven Q&A sites 

scientia potentia est

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

×
×
  • Create New...