html - How to add PHP variables to a href url -


im trying add php variable href url

this code:

php

$uid= $_session['userid']; 

html

<a href=http://example.com/uid= <?php echo ".$uid."?> /a> 

how add, when it, redirect too: http://example.com/uid=.

try this,

<?php @session_start(); $uid= $_session['userid']; ?> <a href="http://example.com/?uid=<?php echo $uid; ?>" >your link text</a>  

Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -