| | | | |
| | |
| Gast
Beiträge: n/a
| Hallo Leute. Ich hatte neulich mal wegen einer offonline Funktion für meine HP gefragt. Nachdem ich ein paar Tipps erhalten habe, habe ich mal selbst herumprobiert und hier ist der Code: Ach vorweg worum es geht. Ich habe die Datei start.php die denn folgenden Code hat: Code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>start</title> <?php error_reporting(E_ALL); include ("offonline.txt"); $link1 = "$location"; echo header('Location: $link1'); ?> <style type="text/css"> <!-- body { background-color: #424b5c; } .Stil1 { color: #CCCCCC; font-weight: bold; } --> </style></head> <body> <div align="center"></div> </p> </p> <p align="center"> </p> </p> </p> <table width="500" border="0" align="center"> <tr> <td height="26"><div align="center" class="Stil1">Einen Moment bitte... </div></td> </tr> </table> <div align="center"></div> </body> </html> Dazu noch offonline.txt in der der link zur offline oder zur online Seite gespeichert ist. Also so: Code: <?php $location = "http://localhost/tests/umleitung/..link"; ?> In der admin.php kann der Link verändert werden. Der Code: Code: <?php if($PHP_AUTH_USER!="xxx" OR $PHP_AUTH_PW!="xxx") { Header('HTTP/1.1 401 Unauthorized'); Header('WWW-Authenticate: Basic realm="Top Secret"'); echo "Mit Abbrechen kommst Du hier nicht rein. exit; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Administration</title> <style type="text/css"> <!-- body { background-color: #424b5c; } .Stil1 {color: #FFFFFF} .Stil2 {color: #FFFFFF; font-weight: bold; } --> </style></head> <body> <p class="Stil1"><samp>Hallo du befndest dich grade im Administrationsbereich von www.xxx.xx. Bist du nicht <?php echo $PHP_AUTH_USER ?> ? Dann haue hier schnell ab. Das hier ist kein Spielplatz. Also bitte. Bis bald...</samp></p> <p class="Stil1"> </p> <p class="Stil1">Start Administration:</p> <p class="Stil2">1. Homepage Status:</p> Hier wird bestommen ob der User auf die Startseite oder auf die offline Seite geleitet werden soll!!!</p> Status: </p> Zum ändern offline + Dateiendung oder index + Dateiendung eingeben und auf aktualisieren klicken!</p> Anfangswert: <?php $location = "http://localhost/tests/umleitung/..link"; ?> </p> <?php $text = "$location"; $fp = fopen ("offonline.txt","w+"); fwrite($fp,$text); fclose($fp); ?> <form name="form1" method="post" action=""> <input name="location" type="text" id="location" value="<?php $location = "http://localhost/tests/umleitung/..link"; ?>"> <input type="submit" name="Submit" value="aktuallisieren"> </form> <p class="Stil2">2. </p> </body> </html> Also admin.php klappt wunderbar. Allerdings wäre es mir lieber wenn man denn Link in offonline.txt mit einem Drup Down Menü änder könnte!!! Kann mir da jemand für einen Tipp geben??? Naja wurum es eigendlich geht ist die start.php. Die Umleitung klappt nicht!!! Kann mir jemand beim beheben dieses Fehlers behilflich sein??? Ich bekomme immer ne Meldung a la: Dokument xxx/xxx.xx/$location konnte nicht gefunden werden. Danke im vorraus… |
| | |
| PHP Code Flüsterer Registriert seit: 21.08.2005 Beiträge: 4682 PHP-Kenntnisse: Fortgeschritten | |
| | |
| Gast
Beiträge: n/a
| start.php Code: <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>start</title>
<?php
error_reporting(E_ALL);
include ("offonline.txt");
$link1 = "$location";
echo header('Location: $link1');
?>
<style type="text/css">
<!--
body {
background-color: #424b5c;
}
.Stil1 {
color: #CCCCCC;
font-weight: bold;
}
-->
</style></head>
<body>
<div align="center"></div>
</p>
</p>
<p align="center"> </p>
</p>
</p>
<table width="500" border="0" align="center">
<tr>
<td height="26"><div align="center" class="Stil1">Einen Moment bitte... </div></td>
</tr>
</table>
<div align="center"></div>
</body>
</html>
Code: <?php $location = "http://localhost/tests/umleitung/..link"; ?> Code: <?php
if($PHP_AUTH_USER!="xxx" OR $PHP_AUTH_PW!="xxx") {
Header('HTTP/1.1 401 Unauthorized');
Header('WWW-Authenticate: Basic realm="Top Secret"');
echo "Mit Abbrechen kommst Du hier nicht rein. ;-) \n";
exit;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Administration</title>
<style type="text/css">
<!--
body {
background-color: #424b5c;
}
.Stil1 {color: #FFFFFF}
.Stil2 {color: #FFFFFF; font-weight: bold; }
-->
</style></head>
<body>
<p class="Stil1"><samp>Hallo du befndest dich grade im Administrationsbereich von www.xxx.xx. Bist du nicht
<?php
echo $PHP_AUTH_USER ?>
? Dann haue hier schnell ab. Das hier ist kein Spielplatz. Also bitte. Bis bald...</samp></p>
<p class="Stil1"></p>
<p class="Stil1">Start Administration:</p>
<p class="Stil2">1. Homepage Status:</p>
Hier wird bestommen ob der User auf die Startseite oder auf die offline Seite geleitet werden soll!!!</p>
Status: </p>
Zum ändern offline + Dateiendung oder index + Dateiendung eingeben und auf aktualisieren klicken!</p>
Anfangswert: <?php $location = "http://localhost/tests/umleitung/..link"; ?> </p>
<?php
$text = "$location";
$fp = fopen ("offonline.txt","w+");
fwrite($fp,$text);
fclose($fp);
?>
<form name="form1" method="post" action="">
<input name="location" type="text" id="location" value="<?php $location = "http://localhost/tests/umleitung/..link"; ?>">
<input type="submit" name="Submit" value="aktuallisieren">
</form>
<p class="Stil2">2. </p>
</body>
</html>
Naja wurum es eigendlich geht ist die start.php. Die Umleitung klappt nicht!!! Kann mir jemand beim beheben dieses Fehlers behilflich sein??? Ich bekomme immer ne Meldung a la: Dokument xxx/xxx.xx/$location konnte nicht gefunden werden. Danke im vorraus… |
| | |
| Gast
Beiträge: n/a
| wieso nennst du die datei offonline.txt? wenn du sie includest wird der code nicht ausgeführt, weil das nur bei *.php datein geschieht. entweder du nennst die datei in offonline.php um, oder gleich nur den link in die txt schreiben und mit file() rausholen... und beim ändern mir dem dropdown menü: |
| | |
| Gast
Beiträge: n/a
| habs grad selber ausprobiert und es geht hab mal bei http://tut.php-q.net gelesen, dass das nicht geht und einfach geglaubt mal edit: nicht richtig gelesen^^ |
| Themen-Optionen | |
| Thema bewerten | |
|
|
Ähnliche Themen | ||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| https header und Cookie | TailerD | PHP Tipps 2008 | 5 | 26.01.2008 19:54 |
| header() ??? | TeazY | PHP Tipps 2008 | 9 | 11.01.2008 15:40 |
| PHP weiterleitung mit header (FEHLER) | PHP Tipps 2006 | 9 | 13.02.2006 14:27 | |
| Header Weiterleitung | duderino | PHP Tipps 2005-2 | 20 | 11.10.2005 21:09 |
| header Weiterleitung [url]www.mobile-clubbing.de/gallerie[/url] | PHP Tipps 2005-2 | 2 | 28.08.2005 19:30 | |
| Problem: Cannot modify header information | Alpha Centauri | PHP Tipps 2005 | 11 | 25.04.2005 13:05 |
| weiterleitung request header | PHP Tipps 2005 | 10 | 04.04.2005 10:33 | |
| weiterleitung mit header aber erst nach 2 oder 3sec | GELight | PHP Tipps 2005 | 6 | 17.03.2005 23:25 |
| header prob mit auth und smarty | PHP Tipps 2005 | 4 | 07.03.2005 12:10 | |
| Redirect mit Header - Problem | PHP Tipps 2005 | 3 | 22.02.2005 10:28 | |
| Weiterleitung mit header | PHP Tipps 2004-2 | 2 | 26.11.2004 13:47 | |
| Alternative Weiterleitung ohne Header? | imported_dex | PHP Tipps 2004 | 2 | 05.11.2004 10:47 |
| Weiterleitung mit header | PHP Tipps 2004 | 10 | 26.09.2004 23:13 | |
| Warning: Cannot modify header... einbinden nicht möglich? | PHP Tipps 2004 | 2 | 07.08.2004 15:06 | |
| Header Probleme! | Calexico | PHP Tipps 2004 | 7 | 30.06.2004 23:05 |
| Besucher kamen über folgende Suchanfragen bei Google auf diese Seite |
| bgcolor als variabelephp |

Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.