从浏览器,php或xml读取变量 [英] read variables from browser, php or xml

查看:56
本文介绍了从浏览器,php或xml读取变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在autoit中有一个应用程序,我需要以某种方式使用autoit读取php代码的结果,因此php代码将检查数据库服务器端,如果可以,则autoit进程将继续,如果没有,它将继续停止.

I have a application in autoit , I need to somehow read a result of a php code using autoit, so the php code will check de DB serverside, and if it`s OK the autoit process will continue, if not it will stop.

推荐答案

您的问题含糊,所以我举一个简单的例子.

Your question is vague, so I give you a simple example.

在网络服务器中创建一个名为"autoit-api.php"的文件.在其中添加代码,如下所示:

Make a file called in the webserver called "autoit-api.php". Put code in it something like this:

$result = mysql_query('SELECT * WHERE 1=1');
if (!$result) {
    die('Invalid query: ' . mysql_error());
} else {
    echo $result;
}

这个想法是,您将使用此文件从数据库中检索数据,然后仅打印它.不要添加任何HTML.仅打印值.

The idea is that you will use this file to retrieve the data from the database, and just print it. Don't add any HTML. Print just the value.

也可以在您自己的计算机上制作一个AutoIt脚本,并将其命名为"retrieve php value.au3"或类似名称.放入这样的代码:

Also make an AutoIt script on your own computer and call it "retrieve php value.au3" or similar. Put in it a code like this:

#include <INet.au3>
$value = _INetGetSource ( "http://www.mywebsite.com/autoit-api.php" )
MsgBox(0, "The value is:", $value)

然后AutoIt将创建一个消息框,其中包含他从php脚本获取的值.

Then AutoIt will make a message box with the value that he got from the php script.

这篇关于从浏览器,php或xml读取变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆