Halo sobat kreatif! 👋
Kali ini kita akan belajar cara membuat website gratis seperti AuraIQ — Tes Aura & IQ yang bisa merekam data pengunjung (IP, lokasi, device) dan punya halaman admin login + laporan otomatis.
Tutorial ini cocok buat:
-
Konten lucu / quiz interaktif
-
Campaign tracker (buat uji link)
-
Belajar dasar hosting & PHP
Dan yang paling penting: GRATIS + HTTPS aktif ✅
🧩 1. Buat Akun di InfinityFree
Langkah pertama, buka situs https://app.infinityfree.net
-
Klik Sign Up
-
Daftar pakai email aktif
-
Setelah login, pilih Create Account
-
Isi domain gratis kamu (contoh:
cekauramurey.gt.tc) -
Tunggu beberapa menit sampai aktif.
✨ InfinityFree = hosting gratis tanpa batas bandwidth & mendukung PHP.
🗂️ 2. Masuk ke File Manager
Setelah domain aktif:
-
Klik akun hosting → File Manager
-
Masuk ke folder
/htdocs -
Hapus semua file default (biasanya
index2.htmlataudefault.php) -
Nanti kita akan upload file website di sini.
🧰 3. Siapkan File Website AuraIQ
Kita akan membuat website mini dengan 4 file utama:
| File | Fungsi |
|---|---|
index.html |
Halaman utama (quiz & interaktif) |
script.js |
Logika JavaScript & kirim data |
simpan.php |
Simpan data pengunjung |
lihat_log.php |
Halaman admin untuk lihat log |
.htaccess |
Redirect HTTPS & keamanan |
🧾 4. Copy Kode Berikut ke File yang Sesuai
🪄 File 1: index.html
<!doctype html>
<html lang="id">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>✨ AuraIQ — Tes Aura & IQ</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<main class="card">
<h1>🔮 AuraIQ — Tes Aura & IQ (Lucu & Spiritual)</h1>
<p class="lead">Klik emoji & jawab quiz, nanti “energi spiritual” kamu akan direkam (lokasi, IP, device, dll) 😆</p>
<section class="panel">
<h2>🌈 Pilih Emoji Aura Kamu</h2>
<div class="choices">
<button class="choice">😀</button>
<button class="choice">😎</button>
<button class="choice">🤔</button>
<button class="choice">😈</button>
</div>
</section>
<section class="panel">
<h2>🧠 Tes IQ Kilat</h2>
<p>8 + 8 = ?</p>
<input id="iqAnswer" placeholder="Tulis jawaban..." />
<button id="iqSubmit">Kirim IQ</button>
</section>
<div id="result" class="result" hidden></div>
<section class="panel">
<h2>💬 Komentar Lucu</h2>
<form id="commentForm">
<textarea id="commentText" placeholder="Ketik komentar..." required></textarea>
<input id="name" placeholder="Nama (opsional)" />
<button type="submit">Kirim</button>
</form>
<div id="commentsList"></div>
</section>
<footer>
<small>🔍 Tracker by AuraIQ — mencatat IP, lokasi, device, OS & campaign</small>
</footer>
</main>
<script src="script.js"></script>
</body>
</html>
🪄 File 2: script.js
document.addEventListener("DOMContentLoaded", () => {
const choices = document.querySelectorAll(".choice");
const iqInput = document.getElementById("iqAnswer");
const iqSubmit = document.getElementById("iqSubmit");
const result = document.getElementById("result");
const commentForm = document.getElementById("commentForm");
const commentsList = document.getElementById("commentsList");
choices.forEach(btn => {
btn.addEventListener("click", () => sendData({ aura: btn.textContent }));
});
iqSubmit.addEventListener("click", () => {
sendData({ iq: iqInput.value });
result.hidden = false;
result.textContent = `✨ IQ spiritual kamu ${Math.floor(Math.random() * 120) + 80}`;
});
commentForm.addEventListener("submit", e => {
e.preventDefault();
const name = document.getElementById("name").value || "Anon";
const text = document.getElementById("commentText").value;
const div = document.createElement("div");
div.textContent = `${name}: ${text}`;
commentsList.prepend(div);
sendData({ comment: text, name });
commentForm.reset();
});
function sendData(extra = {}) {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(pos => {
sendToServer({
...extra,
lat: pos.coords.latitude,
lon: pos.coords.longitude,
});
}, () => sendToServer(extra));
} else {
sendToServer(extra);
}
}
function sendToServer(data) {
fetch("simpan.php", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(data),
});
}
});
🪄 File 3: simpan.php
<?php
header('Content-Type: application/json');
$logFile = __DIR__ . '/data_log.txt';
$input = json_decode(file_get_contents('php://input'), true) ?? [];
$ip = $_SERVER['REMOTE_ADDR'];
$ua = $_SERVER['HTTP_USER_AGENT'] ?? 'unknown';
$time = date('Y-m-d H:i:s');
$data = [
'ip' => $ip,
'time' => $time,
'ua' => $ua,
'extra' => $input
];
file_put_contents($logFile, json_encode($data, JSON_UNESCAPED_UNICODE) . "\n", FILE_APPEND);
echo json_encode(['ok' => true]);
🪄 File 4: lihat_log.php
<?php
session_start();
$PASSWORD = 'adminbisaaja';
$logFile = __DIR__ . '/data_log.txt';
if (isset($_GET['logout'])) {
session_unset(); session_destroy();
header('Location: lihat_log.php'); exit;
}
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if ($_POST['password'] === $PASSWORD) {
$_SESSION['logged'] = true;
header('Location: lihat_log.php'); exit;
} else {
echo "<p style='color:red'>Password salah!</p>";
}
}
if (!isset($_SESSION['logged'])) {
echo "<form method='post'><input type='password' name='password' placeholder='Password admin'><button>Masuk</button></form>";
exit;
}
echo "<a href='?logout=1'>Logout</a><br><pre>";
if (file_exists($logFile)) {
$lines = file($logFile);
foreach (array_slice($lines, -100) as $line) echo htmlspecialchars($line)."\n";
} else echo "Belum ada data.";
echo "</pre>";
?>
🪄 File 5: .htaccess
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
<Files "data_log.txt">
Order allow,deny
Deny from all
</Files>
🔐 5. Aktifkan SSL Gratis di InfinityFree
-
Di panel InfinityFree, buka menu SSL Certificates
-
Klik Request New SSL
-
Masukkan domain kamu (
cekauramurey.gt.tc) -
Tambahkan 2 record CNAME ke DNS domain (di panel
gt.tc) -
Tunggu 30 menit, lalu klik Install Certificate
-
Setelah aktif, buka situs dengan
https://
📊 6. Cek Halaman Admin Log
Buka:
👉 https://namadomainmu/lihat_log.php
Masukkan password: adminbisaaja
Kamu akan melihat data:
-
IP & waktu pengunjung
-
Device & browser
-
Jawaban quiz atau komentar
✅ 7. Hasil Akhir
✨ Website sudah:
-
Gratis 100%
-
HTTPS aktif
-
Bisa diakses di HP / PC
-
Menyimpan data pengunjung otomatis
💡 Tips Tambahan
-
Gunakan domain singkat seperti
linkkocak.gt.tc -
Kamu bisa ubah password admin di
lihat_log.php -
Kalau mau reset data → hapus
data_log.txt
🎁 Penutup
Sekarang kamu sudah bisa bikin website interaktif + tracker tanpa coding rumit!
Cukup dengan InfinityFree & 5 file sederhana, kamu bisa buat banyak project seru, dari tes aura sampai halaman promosi dengan pelacakan pengunjung real-time 🔥
Tidak ada komentar:
Posting Komentar