'Tools', 'server_filter.php' => 'Server Filter', 'IPAddressConverter.php' => 'IP Address Converter', 'Multi-Tool_Page.php' => 'Wrap & Randomize HTML', 'process_Remove_Tag_and_Style.php' => 'Remove Tag and Style', 'hexadecimal_entities_tools.php' => 'Hexadecimal Entities Tools', 'inline-css-converter.html' => 'Inline CSS Converter', 'encoder_lines_base64_and_quoted_p.php' => 'Encode Lines', 'Text_File_Operations.php' => 'Text File Operations', 'mx.php' => 'MX Check', 'Email_Header_Formatter.php' => 'Email Formatter', 'convert_files.php' => 'Upload and Convert Files', 'dmarc_checker.php' => 'DMARC Checker', 'Excel_for_Analysis.html' => 'Excel File for Analysis' ]); // Define tool descriptions define('TOOL_DESCRIPTIONS', [ 'Tools.php' => 'General tools for various tasks and text processing operations.', 'server_filter.php' => 'Advanced server filtering and management tools.', 'IPAddressConverter.php' => 'Convert IP addresses between different formats.', 'Multi-Tool_Page.php' => 'Wrap and randomize HTML content with advanced options.', 'process_Remove_Tag_and_Style.php' => 'Clean HTML by removing tags and inline styles.', 'hexadecimal_entities_tools.php' => 'Convert text to hexadecimal entities and back.', 'inline-css-converter.html' => 'Convert external CSS to inline styles for emails.', 'encoder_lines_base64_and_quoted_p.php' => 'Encode text using Base64 and quoted-printable methods.', 'Text_File_Operations.php' => 'Perform various operations on text files and content.', 'mx.php' => 'Check and analyze MX records for email domains.', 'Email_Header_Formatter.php' => 'Format, analyze and validate email headers.', 'convert_files.php' => 'Upload and convert files between different formats.', 'dmarc_checker.php' => 'Extract domains and check DMARC policies.', 'Excel_for_Analysis.html' => 'Analyze Excel files for data insights and statistics.' ]); // Define tool categories with icons define('TOOL_CATEGORIES', [ 'General Tools' => [ 'icon' => 'fas fa-tools', 'tools' => [ 'Tools.php' => 'Tools', 'server_filter.php' => 'Server Filter', 'IPAddressConverter.php' => 'IP Address Converter' ] ], 'HTML Tools' => [ 'icon' => 'fab fa-html5', 'tools' => [ 'Multi-Tool_Page.php' => 'Wrap & Randomize HTML', 'process_Remove_Tag_and_Style.php' => 'Remove Tag and Style', 'inline-css-converter.html' => 'Inline CSS Converter', 'hexadecimal_entities_tools.php' => 'Hexadecimal Entities Tools' ] ], 'Text Tools' => [ 'icon' => 'fas fa-file-text', 'tools' => [ 'Text_File_Operations.php' => 'Text File Operations', 'encoder_lines_base64_and_quoted_p.php' => 'Encode Lines' ] ], 'Email Tools' => [ 'icon' => 'fas fa-envelope', 'tools' => [ 'Email_Header_Formatter.php' => 'Email Formatter', 'mx.php' => 'MX Check', 'dmarc_checker.php' => 'DMARC Checker' ] ], 'File Tools' => [ 'icon' => 'fas fa-file-upload', 'tools' => [ 'convert_files.php' => 'Upload and Convert Files', 'Excel_for_Analysis.html' => 'Excel File for Analysis' ] ] ]); // Initialize favorites list if (!isset($_SESSION['favorites'])) { $_SESSION['favorites'] = []; } // Handle AJAX requests for favorites if (isset($_POST['action']) && $_POST['action'] === 'toggle_favorite') { $favoritePage = $_POST['page'] ?? ''; if (array_key_exists($favoritePage, ALLOWED_PAGES)) { if (in_array($favoritePage, $_SESSION['favorites'])) { $_SESSION['favorites'] = array_diff($_SESSION['favorites'], [$favoritePage]); echo json_encode(['status' => 'removed', 'message' => 'Removed from favorites']); } else { $_SESSION['favorites'][] = $favoritePage; echo json_encode(['status' => 'added', 'message' => 'Added to favorites']); } } exit; } // Add/remove favorites (fallback for non-AJAX) if (isset($_GET['toggle_favorite'])) { $favoritePage = $_GET['toggle_favorite']; if (array_key_exists($favoritePage, ALLOWED_PAGES)) { if (in_array($favoritePage, $_SESSION['favorites'])) { $_SESSION['favorites'] = array_diff($_SESSION['favorites'], [$favoritePage]); } else { $_SESSION['favorites'][] = $favoritePage; } } // Redirect to prevent resubmission header('Location: ' . $_SERVER['PHP_SELF'] . '?' . http_build_query(['page' => $_GET['page'] ?? DEFAULT_PAGE])); exit; } // Sanitize and validate the 'page' parameter $page = isset($_GET['page']) ? htmlspecialchars($_GET['page'], ENT_QUOTES, 'UTF-8') : DEFAULT_PAGE; if (!array_key_exists($page, ALLOWED_PAGES)) { $page = DEFAULT_PAGE; } // Function to load page content function loadPageContent($page) { $file = basename($page); if ($file === 'Tools.php') { renderToolsPage(); } elseif (file_exists($file)) { // Security check for file inclusion $realPath = realpath($file); $currentDir = realpath('.'); if ($realPath && strpos($realPath, $currentDir) === 0) { include $file; } else { renderErrorPage("Security: File access denied."); } } else { renderErrorPage("The requested page '$file' was not found."); } } // Function to render the tools page function renderToolsPage() { ?>
Professional text processing and analysis tools for developers and system administrators.
Processed results will appear here
Select a processing tool above and paste your text to get started