Here is my form :
<?php
echo '<form method="get" action="" name="formulaire">';
echo '<input type="text" name="info1" title="" value="" />';
echo '<input type="text" name="info2" title="" value="" />';
echo '<input type="text" name="info3" title="" value="" />';
echo '<input type="submit" value="Envoyer" />';
echo '</form>';
echo '$info1 = '.$_GET["info1"].'<br />';
echo '$info2 = '.$_GET["info2"].'<br />';
echo '$info3 = '.$_GET["info3"].'<br />';
?>
My problem is that after submitting, all the variables are displayed in the URL, even if they are empty.
I would like the non-empty variables ONLY to be displayed in the URL.
Is there a way of doing that with PHP ?
ternary operatorGETmethod in the first place; why not just go withPOST? That way it's not going to show anything in the address bar. Is there a special reason for you to useGET?GET, it risks in opening up the proverbial "can(s) of worms", including potential security issues. @MikePurcell