I have this example script in luau:
local HttpService = game:GetService("HttpService")
local scriptUrl = "https://replit.com/@MyUsername/Projectname#index.php"
local requestData = {
username = "JohnDoe",
score = 100
}
local requestBody = HttpService:JSONEncode(requestData)
local response = HttpService:PostAsync(scriptUrl, requestBody)
if response then
local responseData = HttpService:JSONDecode(response)
local responseValue = responseData["response"]
print("Answer: " .. responseValue)
else
print("Error")
end
and on replit I have this in php:
<?php
$requestData = json_decode(file_get_contents('php://input'), true);
$username = $requestData['username'];
$score = $requestData['score'];
echo $score;
echo $username;
$responseData = array(
'response' => 'Daten erfolgreich empfangen und verarbeitet',
'username' => $username,
'score' => $score
);
$responseBody = json_encode($responseData);
header('Content-Type: application/json');
echo $responseBody;
?>
- Is this correct like that?
- How can I make it better?
3.Is there a way with GitHub?
4.I get 403 Forbidden on Roblox.
Ty for your Help!!!