所以我遇到了一个巨大的问题,我的php文件突然没有收到Unity3D的表单字段。我得到的是
注意事项: 未定义变量:姓名 homexxxxxxxpublic_htmlMyGameSave.php 在线 38
代码看起来像这样...
WWWForm form = new WWWForm();
form.AddField("name", usersName);
form.AddField("score", highScore);
WWW www = new WWW("https://www.undivided.com/MyGame/Save.php", form);
yield return www;
这在2周前还能正常工作,但我认为我的网络服务器上发生了一些变化,导致了这种情况。我需要帮助调试,因为我无法确定是哪里出了问题。谁能给我一些调试方法。
我已经找到了这个。
if($_SERVER['REQUEST_METHOD'] == "POST"){
echo "We are POSTing<br />";
}
它打印出来了。
我还打印出了我的$GLOBALS,结果是这样的......。对不起,我写了这么多文字,但我觉得它可能会有帮助......正如你所看到的,没有后变数。
谢谢你
UploadAFile Log Null: We are posting<br>
array(6) {
["_GET"]=>
array(0) {
}
["_POST"]=>
array(0) {
}
["_COOKIE"]=>
array(0) {
}
["_FILES"]=>
array(0) {
}
["_SERVER"]=>
array(50) {
["LSPHP_ENABLE_USER_INI"]=>
string(2) "on"
["PATH"]=>
string(28) "/usr/local/bin:/bin:/bin"
["TEMP"]=>
string(4) "/tmp"
["TMP"]=>
string(4) "/tmp"
["TMPDIR"]=>
string(4) "/tmp"
["PWD"]=>
string(1) "/"
["HTTP_ACCEPT"]=>
string(3) "*/*"
["HTTP_ACCEPT_ENCODING"]=>
string(8) "identity"
["CONTENT_TYPE"]=>
string(33) "application/x-www-form-urlencoded"
["CONTENT_LENGTH"]=>
string(1) "0"
["HTTP_HOST"]=>
string(15) "undivided.com"
["HTTP_USER_AGENT"]=>
string(65) "UnityPlayer/2018.2.15f1 (UnityWebRequest/1.0, libcurl/7.52.0-DEV)"
["HTTP_X_UNITY_VERSION"]=>
string(11) "2018.2.15f1"
["HTTP_X_HTTPS"]=>
string(1) "1"
["REDIRECT_UNIQUE_ID"]=>
string(27) "Xq9g99BbsdgfdsdfsdfgFAAABVY"
["REDIRECT_SCRIPT_URL"]=>
string(34) "/MyGame/Save.html"
["REDIRECT_SCRIPT_URI"]=>
string(57) "https://undivided.com/MyGame/Save.html"
["REDIRECT_SERVER_ADMIN"]=>
string(20) "[email protected]"
["REDIRECT_ps"]=>
string(5) "https"
["REDIRECT_HTTPS"]=>
string(2) "on"
["REDIRECT_SSL_TLS_SNI"]=>
string(15) "undivided.com"
["REDIRECT_STATUS"]=>
string(3) "200"
["UNIQUE_ID"]=>
string(27) "Xq9g99BbmhfghfgsdfgdsZkTEFAAABVY"
["SCRIPT_URL"]=>
string(34) "/MyGame/Save.html"
["SCRIPT_URI"]=>
string(57) "https://undivided.com/MyGame/Save.html"
["SERVER_ADMIN"]=>
string(25) "[email protected]"
["ps"]=>
string(5) "https"
["HTTPS"]=>
string(2) "on"
["SSL_TLS_SNI"]=>
string(15) "undivided.com"
["SERVER_SIGNATURE"]=>
string(0) ""
["SERVER_SOFTWARE"]=>
string(6) "Apache"
["SERVER_NAME"]=>
string(15) "undivided.com"
["SERVER_ADDR"]=>
string(14) "43.234.654.123"
["SERVER_PORT"]=>
string(3) "443"
["REMOTE_ADDR"]=>
string(13) "12.123.12.123"
["DOCUMENT_ROOT"]=>
string(30) "/home/fdgdsfasdf/public_html"
["REQUEST_SCHEME"]=>
string(5) "https"
["CONTEXT_PREFIX"]=>
string(0) ""
["CONTEXT_DOCUMENT_ROOT"]=>
string(30) "/home/fsddasfdsda/public_html"
["SCRIPT_FILENAME"]=>
string(63) "/home/fdsfdsfdsdfs/public_html/MyGame/Save.php"
["REMOTE_PORT"]=>
string(5) "58931"
["REDIRECT_URL"]=>
string(34) "/MyGame/Save.html"
["SERVER_PROTOCOL"]=>
string(8) "HTTP/1.1"
["REQUEST_METHOD"]=>
string(4) "POST"
["QUERY_STRING"]=>
string(0) ""
["REQUEST_URI"]=>
string(34) "/MyGame/Save.html"
["SCRIPT_NAME"]=>
string(33) "/MyGame/Save.php"
["PHP_SELF"]=>
string(33) "/MyGame/Save.php"
["REQUEST_TIME_FLOAT"]=>
float(1588551927.163)
["REQUEST_TIME"]=>
int(1588551927)
}
["GLOBALS"]=>
array(6) {
["_GET"]=>
array(0) {
}
["_POST"]=>
array(0) {
}
["_COOKIE"]=>
array(0) {
}
["_FILES"]=>
array(0) {
}
["_SERVER"]=>
array(50) {
["LSPHP_ENABLE_USER_INI"]=>
string(2) "on"
["PATH"]=>
string(28) "/usr/local/bin:/bin:/bin"
["TEMP"]=>
string(4) "/tmp"
["TMP"]=>
string(4) "/tmp"
["TMPDIR"]=>
string(4) "/tmp"
["PWD"]=>
string(1) "/"
["HTTP_ACCEPT"]=>
string(3) "*/*"
["HTTP_ACCEPT_ENCODING"]=>
string(8) "identity"
["CONTENT_TYPE"]=>
string(33) "application/x-www-form-urlencoded"
["CONTENT_LENGTH"]=>
string(1) "0"
["HTTP_HOST"]=>
string(15) "undivided.com"
["HTTP_USER_AGENT"]=>
string(65) "UnityPlayer/2018.2.15f1 (UnityWebRequest/1.0, libcurl/7.52.0-DEV)"
["HTTP_X_UNITY_VERSION"]=>
string(11) "2018.2.15f1"
["HTTP_X_HTTPS"]=>
string(1) "1"
["REDIRECT_UNIQUE_ID"]=>
string(27) "Xq9g9etrrettgfdgfvvvdskTEFAAABVY"
["REDIRECT_SCRIPT_URL"]=>
string(34) "/MyGame/Save.html"
["REDIRECT_SCRIPT_URI"]=>
string(57) "https://undivided.com/MyGame/Save.html"
["REDIRECT_SERVER_ADMIN"]=>
string(20) "[email protected]"
["REDIRECT_ps"]=>
string(5) "https"
["REDIRECT_HTTPS"]=>
string(2) "on"
["REDIRECT_SSL_TLS_SNI"]=>
string(15) "undivided.com"
["REDIRECT_STATUS"]=>
string(3) "200"
["UNIQUE_ID"]=>
string(27) "Xq9g99BbgfdfhdhgghffdkTEFAAABVY"
["SCRIPT_URL"]=>
string(34) "/MyGame/Save.html"
["SCRIPT_URI"]=>
string(57) "https://undivided.com/MyGame/Save.html"
["SERVER_ADMIN"]=>
string(25) "[email protected]"
["ps"]=>
string(5) "https"
["HTTPS"]=>
string(2) "on"
["SSL_TLS_SNI"]=>
string(15) "undivided.com"
["SERVER_SIGNATURE"]=>
string(0) ""
["SERVER_SOFTWARE"]=>
string(6) "Apache"
["SERVER_NAME"]=>
string(15) "undivided.com"
["SERVER_ADDR"]=>
string(14) "12.123.123.123"
["SERVER_PORT"]=>
string(3) "443"
["REMOTE_ADDR"]=>
string(13) "12.123.12.123"
["DOCUMENT_ROOT"]=>
string(30) "/home/fdsdffdgsdf/public_html"
["REQUEST_SCHEME"]=>
string(5) "https"
["CONTEXT_PREFIX"]=>
string(0) ""
["CONTEXT_DOCUMENT_ROOT"]=>
string(30) "/home/vddgfdsfdsdfs/public_html"
["SCRIPT_FILENAME"]=>
string(63) "/home/hgffdggffgd/public_html/MyGame/Save.php"
["REMOTE_PORT"]=>
string(5) "58931"
["REDIRECT_URL"]=>
string(34) "/MyGame/Save.html"
["SERVER_PROTOCOL"]=>
string(8) "HTTP/1.1"
["REQUEST_METHOD"]=>
string(4) "POST"
["QUERY_STRING"]=>
string(0) ""
["REQUEST_URI"]=>
string(34) "/MyGame/Save.html"
["SCRIPT_NAME"]=>
string(33) "/MyGame/Save.php"
["PHP_SELF"]=>
string(33) "/MyGame/Save.php"
["REQUEST_TIME_FLOAT"]=>
float(1588551927.163)
["REQUEST_TIME"]=>
int(1588551927)
}
["GLOBALS"]=>
*RECURSION*
}
}
N not setS not set<br>
<b>Notice</b>: Undefined variable: name in <b>/home/tidjbg2jr8pe/public_html/DownhillSlalom/SaveScorePOST.php</b> on line <b>38</b><br>
<br>
<b>Notice</b>: Undefined variable: score in <b>/home/tidjbg2jr8pe/public_html/DownhillSlalom/SaveScorePOST.php</b> on line <b>39</b><br>
<br>
failarray(2) {
["User"]=>
NULL
["Score"]=>
NULL
}
他妈的,当我更新我的SSl时发生了一些事情,我想。我的修复方法是改变 https:/www.undivided.comMyGameSave.php到 https:/undivided.comMyGameSave.html。不过谢谢你的帮助。