Untitled
unknown
plain_text
a year ago
1.2 kB
25
No Index
<?php
include("wisex.php");
// JSON formatında gelen veriyi al
$data = json_decode(file_get_contents("php://input"), true);
// Hata kontrolü ekleyelim
if ($data === null) {
die("JSON verisi alınamadı. Gelen veri: " . file_get_contents("php://input"));
}
// Gerekli parametreler var mı kontrol edelim
if (isset($data['wallet_address']) && isset($data['username'])) {
$wallet_address = htmlspecialchars($data['wallet_address']);
$username = htmlspecialchars($data['username']);
try {
// Veritabanına kayıt işlemi
$sorgu = $baglanti->prepare("UPDATE kullanicilar SET wallet_address = :wallet_address WHERE username = :username");
$sorgu->bindParam(':wallet_address', $wallet_address);
$sorgu->bindParam(':username', $username);
if ($sorgu->execute()) {
echo "Cüzdan adresi başarıyla kaydedildi.";
} else {
echo "Kayıt başarısız.";
}
} catch (PDOException $e) {
echo "Veritabanı hatası: " . $e->getMessage();
}
} else {
echo "Geçersiz veri. wallet_address ve username gönderilmeli.";
}
?>
Editor is loading...
Leave a Comment