skrach Posted May 7, 2010 Report Share Posted May 7, 2010 (edited) Sveiki! Man rādās vajadzība izveidot šādu: index.php?page=production&paper pašlaika man ir . $page = (isset($_GET['page'])) ? $_GET['page'] : ''; echo '<ul class="menu">'; echo "<li><a href=\"index.php?page=home\" class=\"" . (($page == "home") ? "current" : "") . "\">". LANG_MENU_HOME ."</a></li>"; echo "<li><a href=\"index.php?page=production\" class=\"" . (($page == "production") ? "current" : "") . "\">". LANG_MENU_PRODUCTION ."</a></li>"; echo '</ul>'; if($page == 'home'){ include "index.php"; } if($page == 'production'){ include "production.php"; } Kāds varētu palīdzēt ? Edited May 7, 2010 by skrach Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted May 7, 2010 Report Share Posted May 7, 2010 Palīdzēt ar ko? Kam būtu jānotiek un kas nenotiek? Quote Link to comment Share on other sites More sharing options...
skrach Posted May 7, 2010 Author Report Share Posted May 7, 2010 Palīdzēt ar ko? Kam būtu jānotiek un kas nenotiek? nu man pašlaik ir poga "Produkcija" index.php?page=production ieejot tajā sadaļā, tur kreisajā menu ir vēl pogas kuras man vajadzētu apmeram tā: index.php?page=production$paper index.php?page=production&box Nemāku izveidot lai pēc index.php?page=production būtu &paper , kad piespiežu citu linku . Quote Link to comment Share on other sites More sharing options...
php newbie Posted May 7, 2010 Report Share Posted May 7, 2010 :D <a href="index.php?page=production&paper">link</a> Quote Link to comment Share on other sites More sharing options...
Nezinītis Posted May 7, 2010 Report Share Posted May 7, 2010 Izmanto htaccess un funkcionālo programmēšanu, būs vieglāk. :/ Quote Link to comment Share on other sites More sharing options...
skrach Posted May 7, 2010 Author Report Share Posted May 7, 2010 :D <a href="index.php?page=production&paper">link</a> aha, bet kā tad es norādīšu tieši kuru php failu man vajag .. ? Quote Link to comment Share on other sites More sharing options...
php newbie Posted May 7, 2010 Report Share Posted May 7, 2010 index.php?page=production&product=paper index.php?page=production&product=box if($page == 'production') { $product = (isset($_GET['product'])) ? $_GET['product'] : ''; switch($product) { case 'paper': include "paper.php"; break; case 'box': include "box.php"; break; default: include "production.php"; break; } } Quote Link to comment Share on other sites More sharing options...
skrach Posted May 7, 2010 Author Report Share Posted May 7, 2010 (edited) index.php?page=production&product=paper index.php?page=production&product=box if($page == 'production') { $product = (isset($_GET['product'])) ? $_GET['product'] : ''; switch($product) { case 'paper': include "paper.php"; break; case 'box': include "box.php"; break; default: include "production.php"; break; } } aaaa jāā .. pareizi.. :D :D Liels liels paldies ka apgaismoji mani.. ;) :D tikai nedaudz savādak. if($page == 'production') { $product = (isset($_GET['product'])) ? $_GET['product'] : ''; if($product == 'paper'){ include "paper.php"; } } Edited May 7, 2010 by skrach Quote Link to comment Share on other sites More sharing options...
emsy Posted May 7, 2010 Report Share Posted May 7, 2010 ar switch mazāks pisaks 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.