Hallksters Posted October 27, 2006 Report Share Posted October 27, 2006 (edited) Labdien man ir viens jautajums kāds ir skripts ta lai kad es uztaisu šitādu daļu mājas lapā: <table> <td width="100">1</td> <td width="600">2</td> <td width="100">3</td> </table> lai man mainas tikai tas kas ir <td width="600">2</a> sitanī šūnā nevis jauna lapa veras valaa nu tipa mainas tikai vidus !? Paldies! Edited October 27, 2006 by Hallksters Link to comment Share on other sites More sharing options...
andrisp Posted October 27, 2006 Report Share Posted October 27, 2006 1) Izmanto komatus, 2) <td> tags ir jānoslēdz ar </td> nevis ar </a> 3) Izmanto AJAX, bet tā kā īstenībā gribi pavisam kaut ko citu, nekā pateici, tad: <table> <td width="100">1</td> <td width="600"> if ($_GET['page'] == 'news') { require('news.php'); } else if ($_GET['page'] == 'kautkas_cits') { require('kautkas_cits.php') } // u.t.t. // Protams, var arī izmantot Switch konstrukciju. </td> <td width="100">3</td> </table> Link to comment Share on other sites More sharing options...
Hallksters Posted October 27, 2006 Author Report Share Posted October 27, 2006 1) Izmanto komatus,2) <td> tags ir jānoslēdz ar </td> nevis ar </a> 3) Izmanto AJAX, bet tā kā īstenībā gribi pavisam kaut ko citu, nekā pateici, tad: <table> <td width="100">1</td> <td width="600"> if ($_GET['page'] == 'news') { require('news.php'); } else if ($_GET['page'] == 'kautkas_cits') { require('kautkas_cits.php') } // u.t.t. // Protams, var arī izmantot Switch konstrukciju. </td> <td width="100">3</td> </table> Diemžēl kaukas neiet man never vala saiti pa vidu es "1" uzlieku kaukadu linku un vins to neatver 2 vietaa! :( Link to comment Share on other sites More sharing options...
andrisp Posted October 27, 2006 Report Share Posted October 27, 2006 "kaukadu linku" ? Ko tas nozīmē ? Pats nezini, ko ieliki ? Link to comment Share on other sites More sharing options...
Hallksters Posted October 27, 2006 Author Report Share Posted October 27, 2006 "kaukadu linku" ? Ko tas nozīmē ? Pats nezini, ko ieliki ? Es liku: ?menu=link Link to comment Share on other sites More sharing options...
andrisp Posted October 29, 2006 Report Share Posted October 29, 2006 Tad $_GET['page'] manis dotājā piemērā pārveido par $_GET['menu']. Link to comment Share on other sites More sharing options...
Virtuall Posted October 29, 2006 Report Share Posted October 29, 2006 (edited) Visērtāk (kaut gan arī ne 100% droši) būtu izvaidot folderi "inc", un tajos ielikt failus "sadaļa.inc.php". Un tad: <td> <?php $fn = 'inc/'.trim($_GET['menu'], './\,;:').'.inc.php'; if (file_exists($fn)) include $fn; else include 'inc/default.inc.php'; ?> </td> P.S. Kad no #php @ irc.lv aizejot jautāji, kam tad ir domāts php.lv, tu laikam domāji ka tam kanālam ar php.lv ir kāds sakars. Nav :) P.P.S. Paldies ka par php.lv eksistenci vispar atgadināji ;) Edited October 29, 2006 by Virtuall Link to comment Share on other sites More sharing options...
Recommended Posts