Jump to content

PHP variables with COM Object


Recommended Posts

How can I pass PHP variables with COM Object?

In the Help file there is a simple http com object example. Something like this:

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("GET","http://localhost/userlist.php?userid=3")
$oHTTP.Send()

Here's the userlist.php source:

<?php
$page = $_GET['userid'];
$log = fopen("users.txt", "a");
fwrite($log, $page ."\n");
fclose($log);
?>

If I open in a browser the url, it will save "3" into users.txt, but if I use the COM Object method, it won't write "3" into users.txt.

I tried $oHTTP.Open with "PUT", and "POST" too, without success.

What's wrong?

Link to comment
Share on other sites

I had same problem but I didn't find any solution with winhttprequest. But maybe it will work when you will add to http header:

Content-Type: application/x-www-form-urlencoded

You can also try this :

#include <INet.au3>
$users= _INetGetSource("http://localhost/userlist.php?userid=3")
Edited by Yuraj

ShellExecute("http://www.yuraj.ucoz.com")ProcessClose(@AutoItPID)

Link to comment
Share on other sites

It's within local area, and I don't have firewall for it. I use firewall only for WAN. I'm sure it can reach the php.

I will check the sended packets with Wireshark and after I compared I'll post the differences.

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