Hide Email.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Hide Email.

    i want admin's email to be inputted as HIDDEN if someone view admin's profile. how can i add it to this code?

    PHP Code:
    <?
    include("include/session.php");
    include("include/protect.php");
    ?>

    <?
    $req_user = trim($_GET['user']);
    if(!$req_user || strlen($req_user) == 0 ||
       !eregi("^([0-9a-z])+$", $req_user) ||
       !$database->usernameTaken($req_user)){
       die("Username not registered");
    }

    if(strcmp($session->username,$req_user) == 0){
       echo "<b>My Account</b>";
    }

    else{
       echo "<b>User Info</b>";
    }

    $req_user_info = $database->getUserInfo($req_user);

    echo "<br><br><b>Username:</b> ".$req_user_info['username']."<br>";

    echo "<b>Email:</b> ".$req_user_info['email']."<br>";

    if(strcmp($session->username,$req_user) == 0){
       echo "<br><a href=\"useredit.php\">Edit Account</a><br>";
    }

    echo "<br>[<a href=\"home.php\">Main Menu</a>]<br>";

    ?>
    and i got only username and email in profile.php. how can i add other features like birthday.
    Last edited by infested13; 21.03.09, 13:38.

    #2
    Originally posted by infested13 View Post
    i want admin's email to be inputted as HIDDEN if someone view admin's profile. how can i add it to this code?

    and i got only username and email in profile.php. how can i add other features like birthday.
    post the mysql tables sructure
    Advertise your mobile site for FREE with AdTwirl

    Comment


      #3
      Originally posted by GumSlone View Post
      post the mysql tables sructure
      here's the code sir.

      PHP Code:
      DROP TABLE IF EXISTS users;

      CREATE TABLE users (
       
      username varchar(30primary key,
       
      password varchar(32),
       
      userid varchar(32),
       
      userlevel tinyint(1unsigned not null,
       
      email varchar(50),
       
      timestamp int(11unsigned not null
      );

      DROP TABLE IF EXISTS active_users;

      CREATE TABLE active_users (
       
      username varchar(30primary key,
       
      timestamp int(11unsigned not null
      );

      DROP TABLE IF EXISTS active_guests;

      CREATE TABLE active_guests (
       
      ip varchar(15primary key,
       
      timestamp int(11unsigned not null
      );

      DROP TABLE IF EXISTS banned_users;

      CREATE TABLE banned_users (
       
      username varchar(30primary key,
       
      timestamp int(11unsigned not null
      ); 

      Comment


        #4
        you need to add additional rows in to the mysql table if you want to show more user info in his profile
        the maximum you can add with the mysql tables posted above is:
        PHP Code:
        echo "<br><br><b>User ID:</b> ".$req_user_info['userid']."<br>"

        echo 
        "<b>Level:</b> ".$req_user_info['userlevel']."<br>"


        and if you want to hide email just remove or comment the line:

        PHP Code:
        echo "<b>Email:</b> ".$req_user_info['email']."<br>"
        Advertise your mobile site for FREE with AdTwirl

        Comment


          #5
          Originally posted by GumSlone View Post
          you need to add additional rows in to the mysql table if you want to show more user info in his profile
          the maximum you can add with the mysql tables posted above is:
          PHP Code:
          echo "<br><br><b>User ID:</b> ".$req_user_info['userid']."<br>"

          echo 
          "<b>Level:</b> ".$req_user_info['userlevel']."<br>"


          and if you want to hide email just remove or comment the line:

          PHP Code:
          echo "<b>Email:</b> ".$req_user_info['email']."<br>"
          ok thanks. about hide email. i dont want to remove it from the other user. just for the admin that will be displayed as HIDDEN. sorry for this noobie question. im just new in PHP and JAVASCRIPT. all i know is html. i think that can be done using if else statement.

          Comment


            #6
            Originally posted by infested13 View Post
            ok thanks. about hide email. i dont want to remove it from the other user. just for the admin that will be displayed as HIDDEN. sorry for this noobie question. im just new in PHP and JAVASCRIPT. all i know is html. i think that can be done using if else statement.
            no problem but i cant find in the script which you have posted a function which checks if user is admin, also in the mysql tables is nothing.

            but normally it would be something like
            PHP Code:
            if(!$admin)echo "<b>Email:</b> ".$req_user_info['email']."<br>"
            im not sure what for the field userlevel is?
            if you give a different levels for users, eg,
            Admin = level 5
            moderator = level 4
            user = level 1

            then the hide admin email will look like this
            PHP Code:
            if($req_user_info['userlevel']!=5)echo "<b>Email:</b> ".$req_user_info['email']."<br>"
            Advertise your mobile site for FREE with AdTwirl

            Comment


              #7
              Originally posted by GumSlone View Post
              no problem but i cant find in the script which you have posted a function which checks if user is admin, also in the mysql tables is nothing.

              but normally it would be something like
              PHP Code:
              if(!$admin)echo "<b>Email:</b> ".$req_user_info['email']."<br>"
              im not sure what for the field userlevel is?
              if you give a different levels for users, eg,
              Admin = level 5
              moderator = level 4
              user = level 1

              then the hide admin email will look like this
              PHP Code:
              if($req_user_info['userlevel']!=5)echo "<b>Email:</b> ".$req_user_info['email']."<br>"
              admin is 9. thanks for this. i got it working! two thumbsup.;)

              Comment


                #8
                thanks sir. i made it like this.

                PHP Code:
                if($req_user_info['userlevel']==9) {
                echo 
                "<b>Email:</b> [HIDDEN]<br>";
                }
                else{
                echo 
                "<b>Email:</b> ".$req_user_info['email']."<br>";

                i dont have any idea of this until u post that code. thanks thanks.;)

                Comment

                Working...
                X