Example:
Someone is currently on this page and want to change the language from lang=en to lang=fr:
http:://domain.com/index.php?p=1&b=1&c=3&d=4&lang=en // I put two colons to disable the link here
How can I keep the rest of the value and just change the lang=en?
Remarks b=1&c=3&d=4 are conditional and may not exist (e.g. it could be only b=1&f=5 sometimes etc)
I can go as far as:
<a href="index.php?p=<?php echo $p; ?>&lang=fr">Change to French</a>
Do I have to go through all possible parameters like:
<?php
IF (ISSET($_REQUEST['b'])) { $b = '&b=' . ($_REQUEST['b']) } else { $b = ''; }
IF (ISSET($_REQUEST['c'])) { $c = '&c=' . ($_REQUEST['c']) } else { $c = ''; }
IF (ISSET($_REQUEST['d'])) { $d = '&d=' . ($_REQUEST['d']) } else { $d = ''; }
?>
<a href="index.php?p=<?php echo $p . $b . $c . $d; ?>&lang=fr">Change to French</a>
Thanks for teaching!