martins256 Posted June 12, 2006 Report Share Posted June 12, 2006 gribeetu zinaat: kaa var dabuut url un vai ir arii taada funkcija, kas paarbauda vai linkaa ir kaadi $_GET un ja nav, tad pievieno ?aaa= , bet ja ir tad &aaa= Link to comment Share on other sites More sharing options...
[Ya] Posted June 12, 2006 Report Share Posted June 12, 2006 (edited) print_r($_SERVER); un pameklē vai arī saskaiti $_GET masīvu un ja ir >0 tad &aaa= ja ne tad ?aaa= Edited June 12, 2006 by [Ya] Link to comment Share on other sites More sharing options...
Vebers Posted June 12, 2006 Report Share Posted June 12, 2006 $get=$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; Link to comment Share on other sites More sharing options...
fassko Posted June 12, 2006 Report Share Posted June 12, 2006 gribeetu zinaat: kaa var dabuut url un vai ir arii taada funkcija, kas paarbauda vai linkaa ir kaadi $_GET un ja nav, tad pievieno ?aaa= , bet ja ir tad &aaa= Skaties kas notiek ar $_GET masīvu, ja tukšs tad liec ?aaa= , ja nē tad &aaa= , bet vispār tādas iebūvētās funkcijas nav, jātaisa pašam ;) Link to comment Share on other sites More sharing options...
martins256 Posted June 12, 2006 Author Report Share Posted June 12, 2006 paldies visiem! Gala rezultāts: <?php if (preg_match("/=/i", $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'])) { ?> <a href="<?php echo $_SERVER['REQUEST_URI']; ?>&val=lv">LV</a> <a href="<?php echo $_SERVER['REQUEST_URI']; ?>&val=ru"> RU</a> <?php } else { ?> <a href="?val=lv">LV</a> <a href="?val=ru"> RU</a> <?php } ?> Link to comment Share on other sites More sharing options...
bubu Posted June 12, 2006 Report Share Posted June 12, 2006 Dzhiizaz... nu wtf? wtf? un wtf? preg_match("/=/i", ... Kam tev tas? Nu kam? Vai strpos vai strstr liekās tev tik sliktas? Link to comment Share on other sites More sharing options...
Recommended Posts