jonis Posted April 22, 2005 Report Share Posted April 22, 2005 Adresei izmantoju $url='http://'; $url.=$_SERVER["HTTP_HOST"]; $url.=$_SERVER["REQUEST_URI"]; Ir valodu paarsleegs. Probleema ir taada ka atkaartoti panjemot teiksim kaadu linku, vinsh nepaarsleedzas piemeeram uz ?val=en&attels=3 ,bet pievieno ?val=en&attels=2&attels=3 un taa taalaak. links <a href="<? echo $url ?>&attels=2">papapa</a>. Un arii ieejot laapaa nevaru izshtukot lai vinsh pie $url (pieliekot kaa mainiigo $valoda nestraadaa.) uzreiz pieliktu defaulto header location iisti neder. valodu piem ?val=en. izmantoju switch - case. Link to comment Share on other sites More sharing options...
bubu Posted April 22, 2005 Report Share Posted April 22, 2005 if (!isset($_GET['val'])) { $_GET['val'] = 'en'; } // un turpmāk darbojoties tev būs uzstādīts tas $_GET['val']. Kad vajadzēs pamainīt to attels: $_GET['attels']=3; un lai izvadītu to $url: $url=array() foreach($_GET as $key=>$value) { $url[] = urlencode($key).'='.urlencode($value); } echo '?'.implode('&',$url); Link to comment Share on other sites More sharing options...
Recommended Posts