什么用苹果脚本,我正从我的本地机器的一些信息。现在我想将这些信息写入MySQL数据库。
我的代码
现在我取得我的所有信息,并将其写入变量。然后我创建一个URL来将这些信息传递给我的PHP脚本,该脚本处理写入数据库的内容。在这个创建的URL字符串中,我用“%20”(因为URL友好性)替换了所有空格。
现在我正在运行一个带有curl导航到指定URL的shell脚本。
set aString to "http://localhost/clientinfo/setlogin.php?a=" & info_hostname & "&b=" & info_modelname & "&c=" & info_macaddress & "&d=" & info_osversion & "&e=" & info_cpuname & "&f=" & info_cpuspeed & "&g=" & info_ram & "&h=" & info_serial
set my text item delimiters to " "
set split_list to every text item of aString
set my text item delimiters to "%20"
set newString to (split_list as text)
do shell script "curl " & newString
的URL生成这个样子的所有编码后:
的问题
PHP脚本告诉我,每一个其他"$_GET"
变量在第一个没有被指定之后。
片段卷曲输出:
<b>Notice</b>: Undefined index: b in <b>setlogin.php</b> on line <b>5</b><br />
当我输出我生成的URL,并将其输入到浏览器中的地址栏中它的工作原理。
curl脚本有什么问题?
如果使用&而不是&?,会发生什么? – PerroVerd
仍然无法使用@PerroVerd – ismaelw
向curl命令添加verbose/trace参数并查看它输出的关于它发送的请求的内容? –