Cibiņš Posted October 11, 2009 Report Share Posted October 11, 2009 (edited) Tātad lapas linku sistēmu failā index.php darbina šis skripts: <?php $pg = $_GET['pg']; if(isset($_GET['pg'])&&$_GET['pg'] != "") { if(file_exists('mape/'.$pg.'.php')) { include('mape/'.$pg.'.php'); } } else { include('mape/lapa.php'); } ?> Man interesē, kāpēc pa tiešo šis skripts (lejā) ievadot adresi URL laukā mbindex.php?MBID=1 strādā, bet ja includo ar to linku sistēmas skriptu tad nestrādā?? Piem linku sistēmai uz kaukādu failu pārslēdzot adrese aiz index.php ir ?pg=lapa..viņa beigās iznāk tā adrese ?pg=mbindex?MBID=1 Kautkā neritīgi, nestrādā kautkas..bet nezinu kas. mbindex.php <?php if (!isset($_GET['MBID'])) exit; function showpost(&$parent) { extract($parent, EXTR_PREFIX_ALL, "msg"); $msg_DateSubmitted = date("jS of F Y", $msg_DateSubmitted); echo "<li><A HREF=\"read.php?Msg=$msg_ID\">$msg_Title</a> posted by <a href=\"mailto:$msg_Email\">$msg_Poster</a> on $msg_DateSubmitted"; $result = mysql_query("SELECT ID, Title, Poster, Email, DateSubmitted FROM pg_home_data WHERE MBID = {$_GET['MBID']} AND Parent = $msg_ID ORDER BY DateSubmitted DESC;"); if (mysql_num_rows($result)) { echo "<ul>"; while ($row = mysql_fetch_assoc($result)) { showpost($row); } echo "</ul>"; } } $result = mysql_query("SELECT ID, Title, Poster, Email, DateSubmitted FROM pg_home_data WHERE MBID = {$_GET['MBID']} AND Parent = 0 ORDER BY DateSubmitted DESC;"); if (!$result) exit; if (!mysql_num_rows($result)) { echo "This messageboard has no posts."; } else { echo "<ul>"; while ($row = mysql_fetch_assoc($result)) { showpost($row); } echo "</ul>"; } ?> Edited October 11, 2009 by MCWeb.lv Quote Link to comment Share on other sites More sharing options...
briedis Posted October 11, 2009 Report Share Posted October 11, 2009 (edited) ?pg=mbindex?MBID=1 vai pareizāk nebūtu šitā? ?pg=mbindex&MBID=1 Un kas notiek, ja pg vietā es padodu "../cita_mape/cits_fails" ? Edited October 11, 2009 by briedis Quote Link to comment Share on other sites More sharing options...
Cibiņš Posted October 11, 2009 Author Report Share Posted October 11, 2009 (edited) ?pg=mbindex?MBID=1 vai pareizāk nebūtu šitā? ?pg=mbindex&MBID=1 Un kas notiek, ja pg vietā es padodu "../cita_mape/cits_fails" ? Paldies briedi :D Strādā :) A kādēļ īsti jālieto tas &?? Tipa tas ir kā UN? Edited October 11, 2009 by MCWeb.lv Quote Link to comment Share on other sites More sharing options...
briedis Posted October 11, 2009 Report Share Posted October 11, 2009 (edited) ? zīme apzīme to, ka būs GET parametri un & zīme vienkārši atdala parametra, vertības pārus index.php?parametrs1=vertiba¶m2=vertiba2¶m3=vertiba3 utt utt Bet tu arī ņem vērā to ko es tev tur vēl teici, citādi galīgi nedrošs kods tev sanāk. Edited October 11, 2009 by briedis Quote Link to comment Share on other sites More sharing options...
Cibiņš Posted October 11, 2009 Author Report Share Posted October 11, 2009 (edited) ? zīme apzīme to, ka būs GET parametri un & zīme vienkārši atdala parametra, vertības pārus index.php?parametrs1=vertiba¶m2=vertiba2¶m3=vertiba3 utt utt Bet tu arī ņem vērā to ko es tev tur vēl teici, citādi galīgi nedrošs kods tev sanāk. Ok skaidrs. Nu ja tā pg vietā ieliek kkādu šmurgu piem /mape1/mape2/ tad nekas tur nestrādā balta lapa vienkarši. Edited October 11, 2009 by MCWeb.lv Quote Link to comment Share on other sites More sharing options...
waplet Posted October 11, 2009 Report Share Posted October 11, 2009 un ja ieliks nullbyte? labi klapējam ciet es jau atkal muļķības pļūtu Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.