Нуждаюсь в помощи :3

Статус
В этой теме нельзя размещать новые ответы.

Zenya

Новичок
Автор темы
3
0
Добрый день!
Столкнулся с такой проблемой...

КОД:
---------------------------------------------------------------------
Time = %A_Hour%:%A_Min%:%A_Sec%
Date = %A_DD%.%A_MM%.%A_Year%
phpserver := "http://dfsdfs.BlackList.php" - не суть

Gui, Add, Edit, x12 y29 w210 h20 vname
Gui, Add, Edit, x12 y79 w210 h20 vprina
Gui, Add, GroupBox, x2 y9 w230 h50 , Ник добавляемого игрока
Gui, Add, GroupBox, x2 y59 w230 h40 , Причина добавления
Gui, Add, Button, x32 y109 w170 h20 gДобавить, Добавить
Gui, Show, x543 y332 h141 w239, New GUI Window

Добавить:
URLDownloadToFile, %phpserver%?Date=%Date%&Time=%Time%&name=%name%&prina=%prina%, %a_temp%/BlackList.php
return
---------------------------------------------------------------------------
Суть такова:
В базу данных отправляет только дату и время, т.е. переменные Time и Date, а вот текст, который я ввожу в Edit - не отправляется, что делать?
Заранее благодарю :3
 

RTD

Нестандартное звание
Модератор
391
414
Код:
url_address := "http://dfsdfs.ru/BlackList.php"
Gui, Add, GroupBox, x2 y9 w230 h50, Ник добавляемого игрока
Gui, Add, Edit, x12 y29 w210 h20 vname
Gui, Add, GroupBox, x2 y59 w230 h40, Причина добавления
Gui, Add, Edit, x12 y79 w210 h20 vprina
Gui, Add, Button, x32 y109 w170 h20 gAdd, Добавить
Gui, Show, x543 y332 h141 w239, Black List
return
Add:
Gui, Submit, NoHide
data := A_DD "." A_MM "." A_Year
time := A_Hour ":" A_Min ":" A_Sec
result := curl(url_address "?data=" data "&time=" time "&name=" name "&prina=" prina)
MsgBox % "Ответ сервера:`n" result
return

curl(adress, type := "application/x-www-form-urlencoded", method := "GET", error_log := false, package := "") {
    if (!RegExMatch(adress, "^http[s]?:\/\/.*\..*$")) {
        return error_log ? "Invalid URL adress (#1)" : false
    } else if (!DllCall("Wininet.dll\InternetGetConnectedState", "Str", 0x20, "Int", 0)) {
        return error_log ? "Not internet connection (#2)" : false
    }
    try {
        http := ComObjCreate("WinHttp.WinHttpRequest.5.1")
        http.Open(method, adress, false)
        http.SetRequestHeader("Referer", adress)
        http.SetRequestHeader("User-Agent", "AHK")
        http.SetRequestHeader("Content-Type", type)
        http.SetRequestHeader("Pragma","no-cache")
        http.Send(package)
        http.WaitForResponse()
        if (!StrLen(http.ResponseText)) {
            return error_log ? "Empty response (#3)" : false
        } else {
            if (http.Status !== 200) {
                return error_log ? http.Status "(" http.StatusText ") (#4)" : false
            } else {
                return http.ResponseText
            }
        }
    } catch e {
        return error_log ? e.message "(#5)" : false   
    }
}
 

Zenya

Новичок
Автор темы
3
0
Код:
url_address := "http://dfsdfs.ru/BlackList.php"
Gui, Add, GroupBox, x2 y9 w230 h50, Ник добавляемого игрока
Gui, Add, Edit, x12 y29 w210 h20 vname
Gui, Add, GroupBox, x2 y59 w230 h40, Причина добавления
Gui, Add, Edit, x12 y79 w210 h20 vprina
Gui, Add, Button, x32 y109 w170 h20 gAdd, Добавить
Gui, Show, x543 y332 h141 w239, Black List
return
Add:
Gui, Submit, NoHide
data := A_DD "." A_MM "." A_Year
time := A_Hour ":" A_Min ":" A_Sec
result := curl(url_address "?data=" data "&time=" time "&name=" name "&prina=" prina)
MsgBox % "Ответ сервера:`n" result
return

curl(adress, type := "application/x-www-form-urlencoded", method := "GET", error_log := false, package := "") {
    if (!RegExMatch(adress, "^http[s]?:\/\/.*\..*$")) {
        return error_log ? "Invalid URL adress (#1)" : false
    } else if (!DllCall("Wininet.dll\InternetGetConnectedState", "Str", 0x20, "Int", 0)) {
        return error_log ? "Not internet connection (#2)" : false
    }
    try {
        http := ComObjCreate("WinHttp.WinHttpRequest.5.1")
        http.Open(method, adress, false)
        http.SetRequestHeader("Referer", adress)
        http.SetRequestHeader("User-Agent", "AHK")
        http.SetRequestHeader("Content-Type", type)
        http.SetRequestHeader("Pragma","no-cache")
        http.Send(package)
        http.WaitForResponse()
        if (!StrLen(http.ResponseText)) {
            return error_log ? "Empty response (#3)" : false
        } else {
            if (http.Status !== 200) {
                return error_log ? http.Status "(" http.StatusText ") (#4)" : false
            } else {
                return http.ResponseText
            }
        }
    } catch e {
        return error_log ? e.message "(#5)" : false  
    }
}
Благодарю)
 
Статус
В этой теме нельзя размещать новые ответы.