Sign in to follow this  
Followers 0
drtrann

return values from PHP

9 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



$data= InetRead("www.WEBSITE.com/authorization.php?email=YOUREMAIL",1) ; 1 = force reload

this still seems to be returning nothing :(

Share this post


Link to post
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.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

@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

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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.

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

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.

 

Share this post


Link to post
Share on other sites

so apparently I'm and idiot and didn't code in the Http:www. soon as i added that it started to work. thanks for all the help guys (again im an idiot)

Share this post


Link to post
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
Sign in to follow this  
Followers 0