File manager - Edit - /home/masterro/whatsapp.subimicrotech.com/webhook.php
Back
<?php // ============================ // CONFIG // ============================ $VERIFY_TOKEN = "mywhatsapp123"; // must match Meta exactly $LOG_FILE = __DIR__ . "/webhook.log"; // ============================ // VERIFY WEBHOOK (GET) // ============================ if ($_SERVER['REQUEST_METHOD'] === 'GET') { if ( isset($_GET['hub_mode']) && isset($_GET['hub_verify_token']) && isset($_GET['hub_challenge']) ) { if ($_GET['hub_verify_token'] === $VERIFY_TOKEN) { http_response_code(200); echo $_GET['hub_challenge']; exit; } else { http_response_code(403); echo "Invalid token"; exit; } } } // ============================ // RECEIVE MESSAGES (POST) // ============================ $input = file_get_contents("php://input"); if ($input) { file_put_contents( $LOG_FILE, date("Y-m-d H:i:s") . " " . $input . PHP_EOL, FILE_APPEND ); } http_response_code(200); echo "OK";
| ver. 1.4 |
Github
|
.
| PHP 8.3.31 | Generation time: 0 |
proxy
|
phpinfo
|
Settings