I'm trying to pass an id in a link href and I need it to be printed in the URL, my code is:
echo "<a href='ville.php?id='"echo.$ville_id."> $ville_nom </a>";
But the id is not print in the url, could you help me with the syntax ?
I'm trying to pass an id in a link href and I need it to be printed in the URL, my code is:
echo "<a href='ville.php?id='"echo.$ville_id."> $ville_nom </a>";
But the id is not print in the url, could you help me with the syntax ?
You have mistake in your usage of echo and your concat was wrong.
The corrected code :
echo "<a href='ville.php?id='".$ville_id."'> $ville_nom ";
When you used the double quote it's not necessary to concat variables to show their content. Be careful: it can be dangerous sometimes.
echo "<a href='ville.php?id=$ville_id'> $ville_nom ";
Try to use this:
echo "<a href='ville.php?id=" . $ville_id . "'>"