millers Posted March 25, 2008 Author Report Share Posted March 25, 2008 diezvai .. Link to comment Share on other sites More sharing options...
andrisp Posted March 25, 2008 Report Share Posted March 25, 2008 Bet tev taču tur jau ir IFi. Kā tos izdomāji ? Vai arī nokopēji kaut kur nemaz nezinot, kā tas strādā ? Link to comment Share on other sites More sharing options...
777 Posted March 25, 2008 Report Share Posted March 25, 2008 domajams kljuda atrodas sheit <?php if(isset($_GET['tag']) && $_GET['tag'] == 'login') { include('inc/erroru.php'); } elseif(isset($_GET['tag']) && $_GET['tag'] == 'Reg') { include('reg/register.php'); } elseif(isset($_GET['tag']) && $_GET['tag'] == 'home') { include('index.php'); } elseif(isset($_GET['tag']) && $_GET['tag'] == 'bug') { include('bugfix.php'); } elseif(isset($_GET['tag']) && $_GET['tag'] == 'sms') { include('inc/erroru.php'); } elseif(isset($_GET['tag']) && $_GET['tag'] == 'about') { include('about.php'); } elseif(isset($_GET['tag']) && $_GET['tag'] == 'contact') { include('contact.php'); } elseif(isset($_GET['tag']) && $_GET['tag'] == 'download') { include('download.php'); } elseif(isset($_GET['tag']) && $_GET['tag'] == 'video') { include('video.php'); } elseif(isset($_GET['tag']) && $_GET['tag'] == 'muzika') { include('muzika.php'); } ?> Link to comment Share on other sites More sharing options...
millers Posted March 25, 2008 Author Report Share Posted March 25, 2008 nee tos if man draugs uzrakstiija un es saprotu ko tas nozime skriptus es saprotu ko nozime bet pats vell laaaga nemaku vinjus rakstiiiti ... Link to comment Share on other sites More sharing options...
Grey_Wolf Posted March 25, 2008 Report Share Posted March 25, 2008 (edited) labak sadi switch (trim($_GET['tag'])) { case 'bla1': $contents='bla1.php'; $virsraksts='BLA1'; break; case 'bla2': $contents='bla2.php'; $virsraksts='BLA2'; break; // turpini case: 'aa' ... break; cik nepieciesams default: shis izpildisies ja nebuus nekas padots ar get, vai arii netiks atrasta sakritiba tb. varetu buut pirmaa lapa.... $contents='bla.php'; $virsraksts='BLA'; } ?> HTMLs ...... te teiksim virsraksts ... vai kas cits <?php echo $virsraksts; ?> atkal HTML <?php include($contents); ?> ... turpinas HTML Shadi bus daudz parskatamak un arii vairak vai mazak PHP atdaliits no HTML ... ka arii ir taads nerakstiits likums ja iespeju vairak par 5-6 tad izmanto Switch konstrukciju .... Edit: es saprotu ko tas nozime skriptus es saprotu ko nozime bet pats vell laaaga nemaku vinjus rakstiiiti ... tas ir kaa nemaki , ja saproti ? if(ja nosacijums ir patiess) { } else // ja nosacijums nav patiess... { } -- > ta tava konstrukcija nav nekas cits kaa shiis pats tikai salikts rindinjaa... Edited March 25, 2008 by Grey_Wolf Link to comment Share on other sites More sharing options...
777 Posted March 25, 2008 Report Share Posted March 25, 2008 (edited) es tev paradiju kur var but kljuda, jebkursh ifinsh atdalas ar { } if() { } elseif() { } Edited March 25, 2008 by 777 Link to comment Share on other sites More sharing options...
Grey_Wolf Posted March 25, 2008 Report Share Posted March 25, 2008 jebkursh ifinsh atdalas ar { } Nee nepatiess apgalvojums jo: if($a==false) echo 'shis izpildaas'; else echo 'shiss Neizpildiisies'; Ar {} atdalas ja ir vairak kaa viena rindinja tb. koda bloks .... Link to comment Share on other sites More sharing options...
millers Posted March 25, 2008 Author Report Share Posted March 25, 2008 soory bet tagad bisku nesapratu .. ko tad man isti dariiti itka es tavu Grey_Wolf ideju ietesteju bet ka spiezu uz link neko netvera... Link to comment Share on other sites More sharing options...
777 Posted March 25, 2008 Report Share Posted March 25, 2008 index.php?tag=bla1 Link to comment Share on other sites More sharing options...
bubu Posted March 25, 2008 Report Share Posted March 25, 2008 Izlasi kļūdas, pārbaudi kodu, padebugo kodu. Link to comment Share on other sites More sharing options...
777 Posted March 25, 2008 Report Share Posted March 25, 2008 bubu :) ja vinam draugs sarakstija ifus ;) doma vinsh saprata , ko tu tagad vinam rekomendeji ? Link to comment Share on other sites More sharing options...
Grey_Wolf Posted March 25, 2008 Report Share Posted March 25, 2008 millers --> tas mans kods izpildes zinja netskjiras no taa ieprieksejaa, vienkarshi parskatamaks un eertaaks (vieglak modificet utt...) takaa meklee vien kur tev ir kljuudas, kaa arii iesleedz arror reportingu .... P.S. aiz defolt: vari ielikt kautvai echo 'aaa nekas netika atrasts'; ;) Link to comment Share on other sites More sharing options...
millers Posted March 25, 2008 Author Report Share Posted March 25, 2008 kr4 rekur mans get file ..\ \ http://paste.php.lv/7050 rekur ka es uz link izvadu .. <a class="hilight" title="video" href="http://ability-uo.sytes.net/uo/?tag=video">Video</a> <a class="hilight" title="muzika" href="http://ability-uo.sytes.net/uo/?tag=muzika">Muzika</a> Link to comment Share on other sites More sharing options...
777 Posted March 25, 2008 Report Share Posted March 25, 2008 :D failus case`os vajag includot ... Link to comment Share on other sites More sharing options...
marcis Posted March 25, 2008 Report Share Posted March 25, 2008 (edited) Nu varbūt pamēģini arī izvadīt $contents un $virsraksts ? EDIT: vai arī inklūdot Edited March 25, 2008 by marcis Link to comment Share on other sites More sharing options...
Recommended Posts