Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- include("include/session.php");
- ?>
- <html>
- <title>Jpmaster77's Login Script</title>
- <body>
- <?
- /* Requested Username error checking */
- $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");
- }
- /* Logged in user viewing own account */
- if(strcmp($session->username,$req_user) == 0){
- echo "<h1>My Account</h1>";
- }
- /* Visitor not viewing own account */
- else{
- echo "<h1>User Info</h1>";
- }
- /* Display requested user information */
- $req_user_info = $database->getUserInfo($req_user);
- /* Username */
- echo "<b>Username: ".$req_user_info['username']."</b><br>";
- /* Email */
- echo "<b>Email:</b> ".$req_user_info['email']."<br>";
- /**
- * Note: when you add your own fields to the users table
- * to hold more information, like homepage, location, etc.
- * they can be easily accessed by the user info array.
- *
- * $session->user_info['location']; (for logged in users)
- *
- * ..and for this page,
- *
- * $req_user_info['location']; (for any user)
- */
- /* If logged in user viewing own account, give link to edit */
- if(strcmp($session->username,$req_user) == 0){
- echo "<br><a href="useredit.php">Edit Account Information</a><br>";
- }
- /* Link back to main */
- echo "<br>Back To [<a href="main.php">Main</a>]<br>";
- ?>
- </body>
- </html>
- <?php
- include('config/db_con.php');
- include('config/config.php');
- $page = 'profile';
- include('header.php');
- require_once("php/core.php");
- $objCore = new Core();
- $objCore->initSessionInfo();
- $objCore->initFormController();
- mysql_connect("$host", "$username", "$password")or die("cannot connect");
- mysql_select_db("$db_name")or die("cannot select DB");
- $get_email = $objCore->getSessionInfo()->getUserInfo('email');
- $get_flname = "SELECT * FROM `users` WHERE email = '$get_email'";
- $res = mysql_query($get_flname) or die(mysql_error());
- $rows = mysql_fetch_array($res);
- $gemail_hash = md5( strtolower( trim( "$get_email" ) ) );
- $req_user = trim(strtolower(str_replace(" ", "", $rows['flname'])));
- ?>
- <div class="content">
- <div class="left">
- <div class="top_box" style="margin-top:0px;">
- <p><h90>Profile: <?php echo $rows['flname']; ?></h90><?php echo $req_user; ?></p>
- </div>
- <div class="box_pad">
- <div class="box" style="border-bottom:1px solid #dbdbdd;">
- <?php if($objCore->getSessionInfo()->isLoggedIn()){ ?>
- <img class="gravatar" src="http://www.gravatar.com/avatar/<?php echo $gemail_hash; ?>?d=mm" />
- <h1><?php echo $rows['flname']; ?></h1><br />
- <a href="editaccount.php">[Edit Account]</a>
- <? if($objCore->isAdmin()) ?>
- <a href="admin.php">[admin]</a>
- <a href="php/corecontroller.php?logoutaction=1">[Logout]</a>
- <? }else{ ?>
- blabla test
- <? } ?>
- <?php unset($objCore); ?>
- </div>
- </div>
- </div>
- <div class="right">
- <? include('ad.php'); ?>
- </div>
- </div>
- <?include('footer.php');?>
- </body>
- $get_email = $objCore->getSessionInfo()->getUserInfo('email');
- $get_flname = "SELECT * FROM `users` WHERE email = '$get_email'";
- $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");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement