Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Extract parameters from the URL
- $redirectUrl = isset($_GET['redirect_to']) ? $_GET['redirect_to'] : 'https://default.url';
- $additionalData = isset($_GET['data']) ? $_GET['data'] : '';
- // Output the HTML with embedded JavaScript
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Redirecting...</title>
- <script>
- // Facebook Pixel or other JavaScript code
- (function() {
- // Example of setting cookies
- document.cookie = "example_cookie=value; path=/; expires=Fri, 31 Dec 2024 23:59:59 GMT";
- // Simulate tracking with Facebook Pixel
- console.log("Facebook Pixel code would run here");
- // Add any additional JavaScript for tracking or cookies
- })();
- // Redirect after a delay (to ensure JavaScript executes)
- setTimeout(function() {
- var redirectUrl = "<?php echo htmlspecialchars($redirectUrl); ?>";
- var additionalData = "<?php echo htmlspecialchars($additionalData); ?>";
- // If you need to append data to the redirect URL
- if (additionalData) {
- redirectUrl += (redirectUrl.includes('?') ? '&' : '?') + "data=" + encodeURIComponent(additionalData);
- }
- // Perform the redirection
- window.location.href = redirectUrl;
- }, 2000); // Adjust delay as needed (e.g., 2000ms = 2 seconds)
- </script>
- </head>
- <body>
- <p>Processing your request... Please wait.</p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment