Fritzbox: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(Die Seite wurde neu angelegt: „= Links = * == IP-Wechsel melden == <syntaxhighlight lang="php" <?php $pwort = 'ihr-passwort'; $dyntxt = "textdatei.txt"; $port = ":8080"; $pwortcontrol = $_…“) |
|||
Zeile 3: | Zeile 3: | ||
== IP-Wechsel melden == | == IP-Wechsel melden == | ||
<syntaxhighlight lang="php" | <syntaxhighlight lang="php"> | ||
<?php | <?php | ||
$pwort = 'ihr-passwort'; | $pwort = 'ihr-passwort'; |
Version vom 22. Oktober 2022, 07:26 Uhr
Links
IP-Wechsel melden
<syntaxhighlight lang="php"> <?php $pwort = 'ihr-passwort'; $dyntxt = "textdatei.txt"; $port = ":8080"; $pwortcontrol = $_GET["pass"]; $IP = $_GET["meineip"]; $FW = $_GET["FW"]; if (file_exists($dyntxt)) {
if ($pwortcontrol == $pwort) { $a = fopen("$dyntxt", "w"); fwrite($a, $IP); fclose($a); } else { $a = fopen("$dyntxt", "r+"); $dynip = fread($a, filesize($dyntxt));
fclose($a); if ($FW == 1) { $url = "https://" . $dynip; } else { $url = "http://" . $dynip . "" . $port; } header("Location: $url"); }
} </syntaxhiglight>