You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// الحصول على عنوان IP الخاص بالزائر
$ip_address = $_SERVER['REMOTE_ADDR'];
// الحصول على عنوان URL للصفحة الحالية
$page_url = $_SERVER['REQUEST_URI'];
// إعداد استعلام SQL لإدخال البيانات
$stmt = $conn->prepare("INSERT INTO page_visits (ip_address, page_url) VALUES (:ip, :url)");
$stmt->bindParam(':ip', $ip_address);
$stmt->bindParam(':url', $page_url);
// تنفيذ الاستعلام
$stmt->execute();
} catch(PDOException $e) {
// يمكنك تسجيل الخطأ هنا بدلاً من عرضه للمستخدم في بيئة الإنتاج
error_log("Database Error: " . $e->getMessage());
}
$conn = null; // إغلاق الاتصال بقاعدة البيانات
?>
mysql.example.com
The text was updated successfully, but these errors were encountered:
mysql.example.com
The text was updated successfully, but these errors were encountered: