Jump to content

return values from PHP


drtrann
 Share

Recommended Posts

hey guys,

i know there are a few similar posts about this topic, but i cant seem to wrap my head around why this isnt working, and when trying the other examples i have found, they dont work either.

so im trying to create an a app that queries a Mysql database through a php script. right now I'm just trying to get a connection between the PHP script and the autoit program, so i've just made a small script that sends and "should" return the value that I sent the PHP file.

basic autoit script:

#include <Inet.au3>
Local $data
$data= InetRead("www.WEBSITE.com/authorization.php?email=YOUREMAIL")
$themsg = BinaryToString($data)
MsgBox(0,"", $themsg)

basic php

<?php

$msg = $_GET ["email"];

echo $msg;

?>

from my basic understanding, this should return the value of email=, and it does in a web browser, but it returns at "" in autoit. im sure i've fundimentally missed something, but i cant for the life of me figure it out. i'd appreciate if someone pointed out where i've messed up. thank you

Edited by drtrann
Link to comment
Share on other sites

@drtrann

It's quite simple, test your page with a browser and if it's working use _INetGetSource.

I suggest you to use TCP sockets which is faster. (I can write you a code for it).

Br, FireFox.

hey firefox,

i have been trying the read/getsource codes, but none of them seem to return the value (but using it in a browser does). the message box always returns empty. I would greatly appreciate an alternative method for how to achieve this.

Edited by drtrann
Link to comment
Share on other sites

i just tested your script from first post and it works with no problem. the php file

<?php
    if (isset($_GET['email'])) {if ($_GET['email'] == 'YOUREMAIL') { echo 'mymail@gmail.com';}}
?>

retyrn on msgbox from autoit mymail@gmail.com

so there isnt anything wrong with it. try restaritng your comp maybe?

can you post output source from browser when you copy paste that adress directly?

Is your site hosted on the compyter where your using autoit script?

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

i just tested your script from first post and it works with no problem. the php file

<?php
if (isset($_GET['email'])) {if ($_GET['email'] == 'YOUREMAIL') { echo 'mymail@gmail.com';}}
?>

retyrn on msgbox from autoit mymail@gmail.com

so there isnt anything wrong with it. try restaritng your comp maybe?

can you post output source from browser when you copy paste that adress directly?

Is your site hosted on the compyter where your using autoit script?

im still recieving no return what so ever.

restarting didnt do anything

no the autoit script is not on the same computer as the web server

pasting the link directly into the browser works

php file output source

<html>

<head>

</head>

<body>mymail@gmail.com</body>

</html>

Edited by drtrann
Link to comment
Share on other sites

well thats strange

tell you what, i'll provide you a link on private message on forum, to the webpage im gona host in next 24h for testing, it will hold the php script i posted on my first post. Please use link form PM in autoit script that you posted on your first original post, and see if youl get any respond from it.

And if you can please provide correct link and original php script to your web page on pm if you wish for me to test your page from the point i stand (in the morning when drinks whare off, im off to sleep for tonight :P).

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

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