Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- For example:
- suppose your user profile url is in the form "http://www.yoursite.com/profile.php?userid=23124"
- If a logged in user is visiting another user's profile
- via above url the userid can be accessed using $_GET['userid'];
- then the code should be like this
- <?php
- session_start();
- uid of visiting user. Can be retrieved from current session
- $logged_user=$_SESSION["current_user_id"];
- //extract the user id of visiting profile
- $u=$_GET['userid'];
- $Owner = "no";
- if($u == $logged_user)
- {
- $Owner = "yes";
- if($logged_user!==$isOwner)
- {
- $query = mysql_query("UPDATE users SET pvs = pvs + 1 WHERE username =$u'") or die(mysql_error());
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement