Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

Fatal error: Call to undefined function getuser() in /home/matureco/public_html/viewprofile.php on line 43

html php

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1 JanRobinsonMurby


    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 07 December 2015 - 01:31 PM

hi i have followed a tutorial through a online website for a program i wanted and it works but now im attempting to add it to my site and i have come across the following error:

Fatal error: Call to undefined function getuser() in /home/matureco/public_html/viewprofile.php on line 43


here is coding for that section

if(isset($_GET['user']) && !empty($_GET['user'])){
    $user = $_GET['user'];
} else {
    $user = $_SESSION['user_id'];
    $my_id = $_SESSION['user_id'];
    $username = getuser($user, 'username');

and here is more

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>";

#2 Blimp


    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 199 posts

Posted 10 December 2015 - 01:11 AM

Can you show me the getuser method? If it's in a file are you sure you've included it?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download