m0zus Posted April 30, 2007 Report Share Posted April 30, 2007 Ēm, nezinu laikam tik vienkāršu lietu - Piemēram salikti linki uz lapām (index.php,faili.php,kkas.php utt) Bet kāds scripts vajadzīgs lai tās lapas atvērtu piem caur index.php?page=1; index.php?page=2 utml. ? ? Pāldies. Link to comment Share on other sites More sharing options...
andrisp Posted April 30, 2007 Report Share Posted April 30, 2007 Nu, piemēram, var šādi: $p = array(1 => 'x.php', 2 => 'asd.php'); if (isset($p[$_GET['page']])) { require($p[$_GET['page']]); } Kaut kā tā. Link to comment Share on other sites More sharing options...
architect Posted May 4, 2007 Report Share Posted May 4, 2007 Nu man vismaz tas nestrādā. Varbūt kko nepareizi daru o.O Link to comment Share on other sites More sharing options...
andrisp Posted May 4, 2007 Report Share Posted May 4, 2007 Nu droši vien, ka nepareizi dari. Man strādā. Link to comment Share on other sites More sharing options...
architect Posted May 4, 2007 Report Share Posted May 4, 2007 Varbūt vari pastāstīt vairāk, es no plika skripta neko nesaprotu :/ Link to comment Share on other sites More sharing options...
Kristabs Posted May 4, 2007 Report Share Posted May 4, 2007 Mēn, http://lv2.php.net/isset http://lv2.php.net/array http://lv.php.net/require Link to comment Share on other sites More sharing options...
dmitriy Posted May 4, 2007 Report Share Posted May 4, 2007 vieniga problema kura var gadities, faili nav viena direktorija Link to comment Share on other sites More sharing options...
overmind Posted May 22, 2007 Report Share Posted May 22, 2007 <?php if(isset ($_GET['p'])) { $page = $_GET['p'].'.php'; if(file_exists($page)) { include($page); } else { include('news.php'); } } else { include('news.php'); } ?> Link to comment Share on other sites More sharing options...
andrisp Posted May 22, 2007 Report Share Posted May 22, 2007 (edited) Atvainojos, viss kaartiibaa :) Edited May 22, 2007 by andrisp Link to comment Share on other sites More sharing options...
Val Posted May 22, 2007 Report Share Posted May 22, 2007 overmind kodā var ne to vien iebarot url'am. Link to comment Share on other sites More sharing options...
overmind Posted May 22, 2007 Report Share Posted May 22, 2007 overmind kodā var ne to vien iebarot url'am. Kā to saprast? Link to comment Share on other sites More sharing options...
bubu Posted May 22, 2007 Report Share Posted May 22, 2007 Piemēram tā, ka tev ir kautkādā direktorijā super_secret.php fails, kura outputs nav ļauts nevienam redzēt. Ļaunais "hakeris" var tavam kodam urlī padot šādu kverija stringu: ?p=celjsh/uz/super_secret Uzmini, kas notiks? http://php.lv/f/index.php?showtopic=5475&a...amp;#entry43949 http://php.lv/f/index.php?showtopic=4522&a...amp;#entry36555 http://php.lv/f/index.php?showtopic=2663&a...amp;#entry19335 http://php.lv/f/index.php?showtopic=2241&a...amp;#entry15805 Link to comment Share on other sites More sharing options...
iall Posted May 23, 2007 Report Share Posted May 23, 2007 Spied :) Link to comment Share on other sites More sharing options...
Recommended Posts