I have a URL that looks like:
example.com/profile.php?id=1
I want to dynamically generate the URL by taking username from the form input in the database's id field. Like :
example.com/profile.php?id=username
This link give errors.If I use below link than it works
example.com/profile.php?id="username"
But , I am facing problem in anchor tag.My Code :
<a href="contributor-profile.php?id=<?PHP echo "$data['id']";?>">
<h4 class="contributor-name">
<?PHP echo $data ['name'];?>
</h4>
</a>
I have also used urlencode fuction but it is not working.
<a href="profile.php?id=<?PHP echo urlencode($data['id']);?>">
<h4>
<?PHP echo $data ['name'];?>
</h4>
</a>