Jump to content

How to include Activex in PHP?


BoBo
 Share

Recommended Posts

Hi again

First ... i never ever have used Activex(AutoitX) before.

But i need something and i hope you guys may help me.

I have a homepage where im able to scan gameserverstats but im not able to start the game with a selected IP.

What i mean is that i want to be able to choose a server from my serverlist and then i wish to have a button which is able to start the game with serverIP as parameter.

The button and the parameters aren´t the problem im able to start the game from my selfbuild GUI that starts the game.exe -IP but i want to have this for my homepage.

so what i have to do to create such a button in my PHP file??

An how is Autoit able to use the PHP Var´s / Parameters?

greetings BoBo

Edited by BoBo
Link to comment
Share on other sites

  • 4 weeks later...

You can't integrate a dll/activex in php...

what you can do is make a small prog that the user will download and once s/he clicks on the link your progg gets downloaded and runs the app with the correct parameter...

you'll just need to make a small progg (or script, vbs?) that php will have to edit to alter the server ip...

gl...

Link to comment
Share on other sites

  • 2 weeks later...

You can't integrate a dll/activex in php...

gl...

Surely you meant, "I can't...."

Not "You can't" - because that would infer that you knew he could not do something, just because you couldnt.

He could always do something like -

<?
$obj = new COM("Autoit.Example");
?>

Save that as whatever, autoit.php, and then run it from the command line, unless you have a server set up on your computer, then you can run it from the server also.

To run it from the command line, you need php on your system, if you do not have it - then go and get it (5) and after you unzip it, just copy all of it to your system32 folder (actually dont need 90 percent of it, but it aint gonna hurt anything)

That will make it so you can just type

php autoit.php from where ever you saved that file.

(Need to register attached DLL, and have the AutoitX3.dll on your system and registered)

autoitcomexample.zip

Edited by Zach
Link to comment
Share on other sites

Oh - and the ocx that in the zip file is as follows

Private Sub UserControl_Initialize()
Set oAutoIt = CreateObject("AutoItX3.Control")

oAutoIt.ToolTip "                                                      Your                                                    ", 100, 100
oAutoIt.Sleep 500
oAutoIt.ToolTip "                                                      Momma                                                       ", 125, 125
oAutoIt.Sleep 500
oAutoIt.ToolTip "                                                      Don't                                                       ", 150, 150
oAutoIt.Sleep 500
oAutoIt.ToolTip "                                                      Dance                                                       ", 175, 175
oAutoIt.Sleep 500
oAutoIt.ToolTip "                                                      And                                                     ", 200, 200
oAutoIt.Sleep 500
oAutoIt.ToolTip "                                                      Your                                                    ", 225, 225
oAutoIt.Sleep 500
oAutoIt.ToolTip "                                                      Daddy                                                       ", 250, 250
oAutoIt.Sleep 500
oAutoIt.ToolTip "                                                      Don't                                                       ", 275, 275
oAutoIt.Sleep 500
oAutoIt.ToolTip "                                                      Rock                                                    ", 300, 300
oAutoIt.Sleep 500
oAutoIt.ToolTip "                                                      N                                                       ", 325, 325
oAutoIt.Sleep 500
oAutoIt.ToolTip "                                                      Roll                                                    ", 350, 350
oAutoIt.Sleep 500
oAutoIt.Run "Notepad.exe", "", oAutoIt.SW_MAXIMIZE
oAutoIt.WinWaitActive "Untitled -"
oAutoIt.Send "Today's time/date is {F5} {ENTER} {ENTER} {ENTER}         BOBO LOVES YOU MAN"
End Sub
Link to comment
Share on other sites

  • 1 month later...

I should mention - I just happened to be working on something using Autoit and vb6 when I read this post (go figure, I would be doing that, and looking in this forum for something :P )

You can call the Autoit DLL directly - no clue why I did not do that, other than vb6 was open and there in front of my face on another monitor.

Link to comment
Share on other sites

  • 2 months later...

Okay, now I've figured it out.

This is an example of opening and closing the CD Tray using AutoItX and PHP.

<?
$obj = new COM("AutoItX3.Control");
$obj->CDTray ("H:", "open");
$obj->Sleep (1000);
$obj->CDTray ("H:", "close");
?>
<html>
<center>CD Tray Opened and closed successfully!</center>
</html>
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...