ScriptDiskutiere Script im Allgemein Forum im Bereich Plesk-Forum; Ich habe ein kleines Script mit dem ich eine IP Adresse anpingen kann ... funktioniert bei mir lokal auf dem pc einwandfrei aber sobald ich ... -
Script Ich habe ein kleines Script mit dem ich eine IP Adresse anpingen kann ... funktioniert bei mir lokal auf dem pc einwandfrei aber sobald ich es auf den Server lade funktioniert es nicht mehr
ist auf dem Plesk Server etwas gesperrt? Code: <!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>IP Tools</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="images/favicon.ico" />
</head>
<?php
error_reporting(E_ALL);
// Put it into whatever directory and call it. That's all.
// Updated to 4.2 code
// Get Variable from form via register globals on/off
// Security problem, $count wasn't checked upon.
// "-" was zapped out....not anymore
//-------------------------
$max_count = 10; //maximum count for ping command
$unix = 0; //set this to 1 if you are on a *unix system
$windows = 1; //set this to 1 if you are on a windows system
// -------------------------
// nothing more to be done.
// -------------------------
//globals on or off ?
$register_globals = (bool) ini_get('register_gobals');
$system = ini_get('system');
$unix = (bool) $unix;
$win = (bool) $windows;
//
If ($register_globals)
{
$ip = getenv(REMOTE_ADDR);
$self = $PHP_SELF;
}
else
{
$submit = $_GET['submit'];
$count = $_GET['count'];
$host = $_GET['host'];
$ip = $_SERVER['REMOTE_ADDR'];
$self = $_SERVER['PHP_SELF'];
};
// form submitted ?
If ($submit == "Ping!")
{
// over count ?
If ($count > $max_count)
{
echo 'Maximum for count is: '.$max_count;
echo 'Back';
}
else
{
// replace bad chars
$host= preg_replace ("/[^A-Za-z0-9.-]/","",$host);
$count= preg_replace ("/[^0-9]/","",$count);
echo '<body bgcolor="#FFFFFF" text="#000000"></body>';
include ('header.php');
?>
<table width="100%">
<tr>
<td width="100%">
[img]images/indent2.png[/img] Ping
</td>
</tr>
</table>
<?php
echo '<pre>';
//check target IP or domain
if ($unix)
{
system ("ping -c$count -w$count $host");
system("killall ping");// kill all ping processes in case there are some stalled ones or use echo 'ping' to execute ping without shell
}
else
{
system("ping -n $count $host");
}
echo '</pre>';
include ('footer.php');
}
}
else
{
echo '<body bgcolor="#FFFFFF" text="#000000"></body>';
include ('header.php');
?>
<table width="100%">
<tr>
<td width="100%">
[img]images/indent2.png[/img] Ping
</td>
</tr>
</table>
<?php
echo '
<font size="2">Your IP is: '.$ip.'</font></p>';
echo '<form methode="post" action="'.$self.'"><input type="hidden" name="phpMyAdmin" value="MqhZfra5yVwS1KFb9%2Ct0HH2sZx2" />';
echo ' Enter IP or Host <input type="text" name="host" value="'.$ip.'"></input>';
echo ' Enter Count <input type="text" name="count" size="2" value="4"></input>';
echo ' <input type="submit" name="submit" value="Ping!"></input>';
echo '</form>';
echo '
'.$system.'';
include ('footer.php');
echo '</body></html>';
}
?> -
Auf anhieb würd ich jetzt folgendes machen:
SafeMode aus
RegisterGlobals auf on
Firewall aus
Und dann nochmal testen. -
Wir haben dein Script mal getestet und bekamen folgende Fehlermeldung,
auf einen Server wo nur safe mode off ist: Code: Notice: Undefined index: submit in /var/www/vhosts/bluehosting.de/httpdocs/ping.php on line 36
Notice: Undefined index: count in /var/www/vhosts/bluehosting.de/httpdocs/ping.php on line 37
Notice: Undefined index: host in /var/www/vhosts/bluehosting.de/httpdocs/ping.php on line 38 RegisterGlobals on würde ich nie Einstellen.
Korrektur
Das Script funktioniert!!!
Wir haben nicht von Windows auf Unix gestellt :oops:
Aber die Fehler zeigt er immer noch an Script Ähnliche Themen zu Script -
Problem mit Multiforum Script: Hallo liebe User des Plesk Forums,
ich hoffe hier kann mir endlich kompetente Hilfe... -
Suche Firewall-Script: Hallo!
Da auf meinem vServer sich die Firewall über Virtuozzo bzw. Plesk nicht speichern läßt,... -
php script per Crontab in Plesk 8.2.1: Hallo Zusammen,
ich bin nicht wirklich fit mit Crontabs. Würde gerne ein PHP Script welches auf... -
Plesk User per Script anlegen: Hi,
kann man über ein externes Script bei Plesk einen Kunden anlegen lassen (z.B. von einem... -
plesk mit eigenem script steuern: Hi, ich möchte plesk mit einem eigenem script steuern (automatisierter) also wenn sich ein kunde... Besucher kamen mit folgenden Begriffen auf die Seite: php ping script,
script ping test mit fehlerausgabe,
ini_get(system),
plesk PHP Notice: Undefined variable: ip,
ping count unix,
ping script,
ping test perl,
ipadresse mit skript pingen unix,
php system ping geht nicht,
php html korrigieren -tidy preg_,
echo ping php,
php5 ping ip adresse,
shell script pingtest,
anping script,
plesk ping per script aufrufen,
php script pingtest,
remote_addr ping,
echoping without body,
unix echo auf ip adresse,
ping script for windows,
ip ping script für unix,
ip anping script für unix,
plesk globals on,
plesk windows script cronjob,
ping kill system
|