Petunjuk Penggunaan

  1. Masukkan URL utama yang ingin digenerate di kolom 'URL'.
  2. Upload file template (.txt) yang berisi struktur HTML yang ingin digunakan (maksimal 5 slot template).
  3. Upload file .txt untuk masing-masing input:
  4. Masukkan 'Link Tujuan' untuk setiap tombol 'Daftar' pada template.
  5. Klik tombol 'Generate' untuk membuat file index.php di dalam folder yang dibuat berdasarkan nama brand.
  6. Periksa folder yang dibuat di path yang sama dengan tool untuk melihat hasilnya.

Script Khusus untuk Template

Gunakan script placeholder berikut pada file template Anda:

"; } // Fungsi untuk membuat angka acak puluhan juta function generateRandomNumber() { return number_format(rand(10000000, 99999999), 0, ',', '.'); } // Fungsi untuk membersihkan nama folder dan URL function sanitizeName($string) { return strtolower(preg_replace('/[^a-zA-Z0-9]/', '-', trim($string))); } // Fungsi untuk menghapus double slash "//" di URL, kecuali pada protokol (http://, https://) function sanitizeUrl($url) { if (preg_match('/^https?:\/\//', $url, $matches)) { $protocol = $matches[0]; $urlWithoutProtocol = substr($url, strlen($protocol)); $urlWithoutProtocol = preg_replace('#/+#', '/', $urlWithoutProtocol); return $protocol . $urlWithoutProtocol; } else { return preg_replace('#/+#', '/', $url); } } // Cek apakah form sudah di-submit if ($_SERVER['REQUEST_METHOD'] === 'POST') { $url = rtrim($_POST['url'], '/'); $linkDaftar = $_POST['link_daftar']; // Baca semua data dari file yang di-upload dan simpan ke dalam array $brands = file($_FILES['brand']['tmp_name'], FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); $titles = file($_FILES['title']['tmp_name'], FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); $metaDescriptions = file($_FILES['meta_description']['tmp_name'], FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); $domainDescriptions = file($_FILES['domain_description']['tmp_name'], FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); $contentUrls = file($_FILES['content_url']['tmp_name'], FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); // Baca semua template yang di-upload (hingga maksimal 5 template) $templates = []; for ($j = 1; $j <= 5; $j++) { if (!empty($_FILES["template_$j"]['tmp_name'])) { $templates[] = file_get_contents($_FILES["template_$j"]['tmp_name']); } } // Pastikan semua file memiliki setidaknya satu template if (empty($templates)) { echo ""; exit(); } // Cek jumlah baris terbesar dan sesuaikan data $totalEntries = max(count($brands), count($titles), count($metaDescriptions), count($domainDescriptions), count($contentUrls)); // Loop untuk setiap brand di dalam daftar for ($i = 0; $i < $totalEntries; $i++) { $brand = trim($brands[$i % count($brands)]); // Looping jika jumlah list lebih sedikit $title = trim($titles[$i % count($titles)]); $metaDescription = trim($metaDescriptions[$i % count($metaDescriptions)]); $domainDescription = trim($domainDescriptions[$i % count($domainDescriptions)]); $contentUrl = trim($contentUrls[$i % count($contentUrls)]); // Membersihkan nama brand untuk dijadikan nama folder dan URL $cleanBrand = sanitizeName($brand); // Buat folder berdasarkan nama brand yang sudah di-clean (di path yang sama dengan tools ini) if (!file_exists($cleanBrand)) { mkdir($cleanBrand, 0777, true); } // Buat URL unik untuk setiap folder yang sudah di-clean $uniqueUrl = sanitizeUrl($url . '/' . $cleanBrand); // Pilih template secara bergantian $template = $templates[$i % count($templates)]; // Ganti placeholder dalam template dengan data yang diunggah $templateModified = str_replace('{brand}', $brand, $template); $templateModified = str_replace('{title}', $title, $templateModified); $templateModified = str_replace('{description}', $domainDescription, $templateModified); $templateModified = str_replace('{url}', $uniqueUrl, $templateModified); $templateModified = str_replace('{content_url}', $contentUrl, $templateModified); $templateModified = str_replace('{canonical}', $uniqueUrl, $templateModified); $templateModified = str_replace('{og:url}', $uniqueUrl, $templateModified); $templateModified = str_replace('{og:description}', $metaDescription, $templateModified); $templateModified = str_replace('{link_daftar}', sanitizeUrl($linkDaftar), $templateModified); $templateModified = str_replace('{random_number}', generateRandomNumber(), $templateModified); // Tambahkan error_reporting di dalam file index.php yang digenerate untuk menonaktifkan Notice $templateModified = "\n" . $templateModified; // Simpan template yang sudah diubah menjadi index.php di folder brand $filePath = $cleanBrand . '/index.php'; if (file_put_contents($filePath, $templateModified)) { echo ""; } else { echo ""; } } echo ""; } ?> Tools Generator Landing Page
Logo

Tools Generator Landing Page