0
How to use php variable in html href
<input type="text" name="example"> <?php $ex = $_REQUEST['example']; ?> <a href="http://example.com/number=<?php $ex ?>"> it only show http://example.com/number= how to fix it so the $ex will be combine with link ?
2 Respostas
+ 2
Try to echo the variable value. It seems your anchor tag was not closed, don't forget to close the anchor tag.
<a href="http://example.com/number=<?php echo $ex; ?>">The hyperlink text</a>
Is there a specific reason for using $_REQUEST opposed to $_POST or $_GET?
0
juste make<a href="<?= $your_variable ?>" >exemple</a>