Stránka: 1 z 1
| [ Príspevkov: 7 ] | |
Autor | Správa |
---|
Registrovaný: 06.12.06 Prihlásený: 21.02.15 Príspevky: 183 Témy: 59 | 59 |
mam mensi problem ...mam script na zaheslovanie stranok a chcem aby po zaadani spravneho hesla sa to presmerovalo na napr. index.php?go=chaty
myslim ze sa to zapisuje takto : header("location:../index.php?go=chaty");
ale neviem kde to mam dat do toho scriptu ..dik
toto je ten script
Kód: <?php
$allowed_user = array("TOMAS"); $pristup = array("TOMAS"=>"TOMAS"); if (!isset($_SERVER['PHP_AUTH_USER'])): Header("$SERVER_PROTOCOL 401 Unauthorized"); Header("WWW-Authenticate: Basic realm='crazy-design'"); echo "Autorizujte se prosím ";
exit; else: $isin = false; if (isset($allowed_user) && in_array($_SERVER['PHP_AUTH_USER'],$allowed_user)) $isin = true; if (!$isin || $pristup[$_SERVER['PHP_AUTH_USER']]!=$_SERVER['PHP_AUTH_PW'] || !isset($pristup[$_SERVER['PHP_AUTH_USER']])): Header("$SERVER_PROTOCOL 401 Unauthorized"); Header("WWW-Authenticate: Basic realm='Prihláste sa prosím"); echo "Zadené heslo nie je správné<br>"; echo "Autorizacny skript napisal : <a href='http://www.crazy-design.iprofil.cz/'>crazy-design</a><br> <b>crazy-design !</b>"; exit; endif; endif; ?>
|
|
Registrovaný: 30.05.06 Prihlásený: 08.10.14 Príspevky: 1756 Témy: 35 | 35 Bydlisko: BA - WESTSIDE |
Neviem, či je vkladanie hesiel ako plain textu najlepšie riešenie, ale budiž, zatiaľ ťa to nepáli. Inak máš ten kód napísaný strašne neprehľadne, aj sa v ňom vyznáš? ![:)](https://www.pcforum.sk/images/smilies/smile02.gif) Ja som na to najprv tiež čumel ako puk, potom som si to prepísal do môjho "zrozumiteľnejšieho" štýlu a hneď som zbadal, kde by asi tak malo byť to presmerovanie:
Kód: <?php $allowed_user = array("TOMAS"); $pristup = array("TOMAS"=>"TOMAS"); if (!isset($_SERVER['PHP_AUTH_USER'])) { Header("$SERVER_PROTOCOL 401 Unauthorized"); Header("WWW-Authenticate: Basic realm='crazy-design'"); echo "Autorizujte se prosím "; exit; } else { $isin = false; if (isset($allowed_user) && in_array($_SERVER['PHP_AUTH_USER'], $allowed_user)){ $isin = true; } if ( !$isin || $pristup[$_SERVER['PHP_AUTH_USER']]!=$_SERVER['PHP_AUTH_PW'] || !isset($pristup[$_SERVER['PHP_AUTH_USER']]) ){ Header("$SERVER_PROTOCOL 401 Unauthorized"); Header("WWW-Authenticate: Basic realm='Prihláste sa prosím"); echo "Zadené heslo nie je správné<br>"; echo "Autorizacny skript napisal : <a href='http://www.crazy-design.iprofil.cz/'>crazy-design</a><br> <b>crazy-design !</b>"; exit; } else { // juchú, môžeš to presmerovať } } ?>
_________________
A. S. Tanenbaum píše: The terms LF, MF, and HF refer to low, medium, and high frequency, respectively. Clearly, when the names were assigned, nobody expected to go above 10 MHz, so the higher bands were later named the Very, Ultra, Super, Extremely, and Tremendously High Frequency bands. Beyond that there are no names, but Incredibly, Astonishingly, and Prodigiously high frequency (IHF, AHF, and PHF) would sound nice. |
|
Registrovaný: 10.02.07 Prihlásený: 14.08.09 Príspevky: 255 Témy: 27 | 27 Bydlisko: KE |
oftopic, ked sme pri tom sprehladnovani, nemas nejaky nastroj na sprehladnenie roznych kodov? javascript, php.. hmm?
_________________ drahi hackeri! teraz mozete okamzite premazat cely tento server! stlacte skratku ALT+F13 |
|
Registrovaný: 30.05.06 Prihlásený: 08.10.14 Príspevky: 1756 Témy: 35 | 35 Bydlisko: BA - WESTSIDE |
V PSPade je také niečo, ale funguje to len na HTML.
_________________
A. S. Tanenbaum píše: The terms LF, MF, and HF refer to low, medium, and high frequency, respectively. Clearly, when the names were assigned, nobody expected to go above 10 MHz, so the higher bands were later named the Very, Ultra, Super, Extremely, and Tremendously High Frequency bands. Beyond that there are no names, but Incredibly, Astonishingly, and Prodigiously high frequency (IHF, AHF, and PHF) would sound nice. |
|
Registrovaný: 10.02.07 Prihlásený: 14.08.09 Príspevky: 255 Témy: 27 | 27 Bydlisko: KE |
to poznam, aj pouzivam
_________________ drahi hackeri! teraz mozete okamzite premazat cely tento server! stlacte skratku ALT+F13 |
|
Registrovaný: 06.12.06 Prihlásený: 21.02.15 Príspevky: 183 Témy: 59 | 59 |
diky ide to ale este je tam maly problem : po zadani hesla ten link ale nenacita ho .musim zastavit nacitavanie a potom dat refresh a vtedy to ide v pohode
nechyba tam nieco v tom kode este ?
|
|
Registrovaný: 30.05.06 Prihlásený: 08.10.14 Príspevky: 1756 Témy: 35 | 35 Bydlisko: BA - WESTSIDE |
A nehodí ťa to potom náhodou do slučky, v ktorej sa jeden súbor presmeruje na druhý a ten zase na prvý a tak dokola?
BTW občas keby si si po sebe prečítal, čo si práve napísal, odhalil by si množstvo chýb a my ostatní by sme aspoň na prvý krát porozumeli tvojmu textu a nemuseli to lúštiť... ![;)](https://www.pcforum.sk/images/smilies/smile03.gif)
_________________
A. S. Tanenbaum píše: The terms LF, MF, and HF refer to low, medium, and high frequency, respectively. Clearly, when the names were assigned, nobody expected to go above 10 MHz, so the higher bands were later named the Very, Ultra, Super, Extremely, and Tremendously High Frequency bands. Beyond that there are no names, but Incredibly, Astonishingly, and Prodigiously high frequency (IHF, AHF, and PHF) would sound nice. |
|
Stránka: 1 z 1
| [ Príspevkov: 7 ] | |
Podobné témy | Témy | Odpovede | Zobrazenia | Posledný príspevok |
---|
![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v HTML, XHTML, XML, CSS | 1 | 508 | 17.02.2009 21:19 stenley | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v Ostatné programy | 4 | 761 | 11.07.2008 23:35 Prison Break | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v Monitory, televízory a projektory | 8 | 481 | 22.08.2014 1:12 brmbo | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read_hot.gif) | [ Choď na stránku: 1, 2 ] v PHP, ASP | 55 | 2425 | 16.01.2009 13:55 stenley | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v HTML, XHTML, XML, CSS | 2 | 773 | 27.12.2006 17:45 xp22 | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read_hot.gif) | v Antivíry a antispywary | 16 | 3125 | 13.08.2009 15:05 Palinhoo | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read_hot.gif) | v Operačné systémy Microsoft | 12 | 787 | 17.01.2008 14:25 _DanWer_ | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v HTML, XHTML, XML, CSS | 2 | 745 | 04.11.2007 18:10 enorm | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v Biosy a ladenie výkonu | 3 | 586 | 11.03.2008 17:31 cauapistemi | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read_hot.gif) | v Ostatné | 13 | 1445 | 22.06.2011 19:49 svk_deef | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read_hot.gif) | v Biosy a ladenie výkonu | 19 | 1159 | 06.07.2007 22:08 Pumperko | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v PHP, ASP | 1 | 311 | 27.01.2013 14:23 shaggy | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read_hot.gif) | v AMD - Advanced Micro Devices | 13 | 964 | 14.08.2007 5:55 papaya27 | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v PHP, ASP | 5 | 617 | 18.05.2008 10:46 Blackdevil | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v PHP, ASP | 4 | 549 | 03.07.2007 11:35 kmsa | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v Operačné systémy Microsoft | 4 | 419 | 27.03.2008 12:19 maurus |
|