hi i have followed a online tutorial for a friends system all is working till i attempt to install it on my website after adding the following code
<?php
if(isset($_GET['user']) && !empty($_GET['user'])){
$user = $_GET['user'];
} else {
$user = $_SESSION['user_id'];
}
$my_id = $_SESSION['user_id'];
$username = getuser($user, 'username');
?>
<?php
if($user != $my_id){
$check_frnd_query = @mysql_query("SELECT id FROM frnds WHERE (user_one='$my_id' AND user_two='$user') OR (user_one='$user' AND user_two='$my_id')");
if(@mysql_num_rows($check_frnd_query) == 1){
echo "<a href='#' class='box'>Already Friends</a> | <a href='actions.php?action=unfrnd&user=$user' class='box'>Delete From Friends</a>";
} else {
$from_query = @mysql_query("SELECT `id` FROM `frnd_req` WHERE `from`='$user' AND `to`='$my_id'");
$to_query = @mysql_query("SELECT `id` FROM `frnd_req` WHERE `from`='$my_id' AND `to`='$user'");
if(@mysql_num_rows($from_query) == 1){
echo "<a href='#' class='box'>Ignore</a> | <a href='actions.php?action=accept&user=$user' class='box'>Accept</a>";
} else if (@mysql_num_rows($to_query) == 1){
echo "<a href='actions.php?action=cancel&user=$user' class='box'>Cancel Request</a>";
} else {
echo "<a href='actions.php?action=send&user=$user' class='box'>Send Request</a>";
}
}
}
?>
to my profile page i get Fatal error: Call to undefined function getuser() in /home/matureco/public_html/viewprofile.php on line 45
what would the solution be any help would be greatful x