How to retrieve user data from URL?

How to retrieve user data from URL?

like you click on a username and url is
domain.com/?user=samee
now you can get data from it

like query will be
select * from users where user = samee limit 1
It will by query

now how to start

in header before <html> you need to write code

 $username = $_GET['user']; //now you have username variable  
 $query = "select * from users where user = $username limit 1";  
 $query_run = mysqli_query($con, $query);  
 $user = mysqli_fetch_array($query_run);  
 //here you will get complete user data and now you need to put on page  
 <html>  
  <head>  
  </head>  
 <body>  
  <p>Name = <?php echo $user[name]; ?></p>  
  <p>age = <?php echo $user[age]; ?></p>  
  <p>Address = <?php echo $user[address]; ?></p>  
  </body>  
 </html>  

Post a Comment

Give your reviews about this blog. Leave your comments. What do you think about this post?

Comments Guidelines:

1) I love to read comments, but please avoid spam.

2) Like this blog, share your insights, and spread the word.

3) You can use basic HTML/xHTML tags.

4) All comments are DoFollow—please use the section professionally.

5) Kindly mention your name or brand below your comment.

6) Constructive suggestions for improvement are always welcome.


Thanks for visiting Samee Articles.

========================================

Best Regards,

Samee U. Feroz

 
Copyright © 2011-2026. Samee Articles - All Rights Reserved
Proudly powered by Blogger