How to keep already-set GET parameter values on form submission?
You can add two hidden fields in the form on the first target site, blabla.php in your case:
<form ...>
<input type="hidden" name="name" value="<?php echo htmlspecialchars($_GET['name']);?>">
<input type="hidden" name="lName" value="<?php echo htmlspecialchars($_GET['lName']);?>">
<!-- rest of the form here -->
</form>
For a dynamic solution, use a foreach loop:
<?php
foreach($_GET as $name => $value) {
$name = htmlspecialchars($name);
$value = htmlspecialchars($value);
echo '<input type="hidden" name="'. $name .'" value="'. $value .'">';
}
?>
You may consider locking the dynamic approach down to a list of known possible keys:
<?php
$keys = array('name', 'lName', ...);
foreach($keys as $name) {
if(!isset($_GET[$name])) {
continue;
}
$value = htmlspecialchars($_GET[$name]);
$name = htmlspecialchars($name);
echo '<input type="hidden" name="'. $name .'" value="'. $value .'">';
}
?>
A simpler solution to keep the URL unchanged by using http_build_query
<form action="<?php echo $_SERVER["PHP_SELF"] . '?'.http_build_query($_GET); ?>" ...
..
..