yeonghoon.kim

  • 게시판
  • 갤러리
  • aws

간단 텔레그램 메세지 전송 php

김영훈 2022.08.10 11:30 조회 수 : 339

<?php
/*
 * https://yeonghoon.kim/telegram_msg.php?msg=내용&token=token
 * hostname은 option
 */
$bot_id = 'bot_id';
$chat_id = 'chat_id';
$send_url = "https://api.telegram.org/bot${bot_id}/sendmessage?chat_id=${chat_id}&text=";
$remote_ip = $_SERVER["REMOTE_ADDR"];
$msg = $_REQUEST['msg'];
$hostname = $_REQUEST['hostname'];
$token = $_REQUEST['token'];

 

if($remote_ip && $msg && $token == 'token') {
    $content = urlencode("[ $remote_ip ] $hostname
$msg");
    echo file_get_contents($send_url.$content);
    exit();
}
http_response_code(404);
exit();
?>


  • 추천 0

  • 비추천 0
이 게시물을
목록

댓글 0

사진 및 파일 첨부

여기에 파일을 끌어 놓거나 왼쪽의 버튼을 클릭하세요.

파일 용량 제한 : 0MB (허용 확장자 : *.*)

업로드 중... (0%)

0개 첨부 됨 ( / )
 
번호 제목 글쓴이 날짜 조회 수
공지 2025 일본 여행 계획 김영훈 2024.10.10 1182
공지 현금, 저축, 투자, 지출, 예산, 보험 내역(2024-05-30) 김영훈 2024.03.10 907
» 간단 텔레그램 메세지 전송 php 김영훈 2022.08.10 339
64 docker-compose mariadb 샘플 김영훈 2022.08.11 356
63 opendkim-genkey 임의 서브도메인 지정 김영훈 2022.08.12 259
62 NCP - SourceCommit 저장소 생성 file 김영훈 2022.08.18 325
61 우분투 22.04 remove.bg 설치 김영훈 2022.09.22 343
60 CentOS7 EUC-KR 로케일 설정 김영훈 2022.10.20 298
59 CentOS8-Stream packstack 설치 [5] 김영훈 2022.11.24 415
58 Centos Console 화면 보호기 setterm 김영훈 2022.11.26 228
57 mac에서 centos6 ssh 접속 시 오류 - no matching host key type found. Their offer: ssh-rsa,ssh-dss 김영훈 2022.11.27 408
56 Your account is pending approval from your GitLab administrator and hence blocked. Please contact your GitLab administrator if you think this is an error. 김영훈 2022.11.28 481
55 centos7 gitlab 설치 김영훈 2022.11.28 342
54 mac homebrew 설치 김영훈 2022.11.30 237
53 growpart - no tools available to resize disk with 'gpt' 김영훈 2022.12.01 286
52 CentOS7 - minikube 설치 김영훈 2022.12.02 410
51 CentOS7 아나콘다 환경에 주피터 노트북 설치 김영훈 2022.12.03 667
50 python - random 라이브러리 김영훈 2022.12.19 316
49 python - socket 라이브러리 김영훈 2022.12.19 363
48 python - requests 라이브러리 김영훈 2022.12.19 271
47 python - re 라이브러리 김영훈 2022.12.19 348
46 Uptime Kuma용 push(패시브) 체크용 파일.py [1] 김영훈 2022.12.21 325
쓰기 태그
 첫 페이지 5 6 7 8 9 10 11 12 13 14 끝 페이지