Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta charset="utf-8" />
- <title>Search Domian</title>
- </head>
- <body>
- <?php
- // define('APP', dirname(__DIR__));
- // require_once APP . '/PleskApiClient.php';
- require_once('PleskApiClient.php');
- $HTML = array();
- // Config.
- $cfg = array(
- 'login' => 'admin',
- 'password' => 'admin',
- 'domain' => isset($_GET['domain']) ? $_GET['domain'] : '',
- 'servers' => array(
- '213.145.129.2', // server one
- '213.145.129.3', // server two
- '213.145.129.4',
- '213.145.129.5')
- );
- function request($cfg, $host) {
- $client = new PleskApiClient($host);
- $client->setCredentials($cfg['login'], $cfg['password']);
- // $request = file_get_contents("_request.xml");
- $request = <<<EOF
- <packet version="1.6.3.0">
- <site>
- <get>
- <filter>
- <name>$domain</name>
- </filter>
- <dataset>
- <gen_info/>
- </dataset>
- </get>
- </site>
- </packet>
- EOF;
- $response = $client->request($request);
- $stats = new SimpleXMLElement($response);
- return $stats->site->get->result->status;
- }
- if (!empty($cfg['domain'])) {
- $HTML['STATUS'] = '';
- foreach ($cfg['servers'] as $host) {
- $status = request($cfg, $host);
- if ($status == 'ok') {
- $HTML['STATUS'] .= 'Сайт ' . $cfg['domain'] . ' найден на ' . $host . "<br />\n";
- } else {
- $HTML['STATUS'] .= 'Сайт ' . $cfg['domain'] . ' не найден на ' . $host . "<br />\n";
- }
- }
- }
- ?>
- <form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="GET">
- <input type="text" name="domain" placeholder="Введите домен" />
- <input type="submit" value="Найти" />
- </form>
- <br />
- <div class="vixlop"><?php if (isset($HTML['STATUS'])) echo $HTML['STATUS']; ?></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement