Так что у меня возникла огромная проблема, когда мои php файлы не получают мои поля формы от Unity3D внезапно. Я получаю
Уведомление : неопределенная переменная: имя в / home / xxxxxxx / public_html / MyGame / Save. 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 недели go, но я думаю, что что-то изменилось на моем веб-сервер для осуществления этого. Мне нужна помощь в отладке этого, так как я не могу точно определить, что пошло не так. Может кто-нибудь предложить некоторые методы отладки.
Я нашел это.
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) "security@mywebsite.com.au"
["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) "webmaster@undivided.com"
["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) "security@mywebsite.com.au"
["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) "webmaster@undivided.com"
["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
}