2
Through a URL, I want to display a set of information in the HTML of the page, however, there are values I want to repeat in certain URL’s and others not.
Example:
http://wwww.example.com/example.php?c=resultado1
<?php echo "<div class='campo1'>" . $_GET['c'] . "</div>" ;?>
I want to repeat the $_GET['c']
in the URL, and automatically generate a new DIV with the new value passed by the URL
http://wwww.example.com/example.php?c=resultado1&c2=resultado2
What I’m not getting is to hit PHP in HTML. I tried to duplicate the function echo
above, but if I don’t enter her GET value in the URL, the DIV is displayed anyway (blank), something I don’t want to happen. How should I proceed?
Recalling that the isset does not validate if the variable is empty, only if it exists. So if the parameter via $_GET comes and is empty, isset returns true.
– Vinicius Souza