/    Sign up×
Community /Pin to ProfileBookmark

PHP Login code integrating help….

I have a PHP login system that i need help integrating into my website. The following code is the specific code i need to be integrated into the other following code which is my login section on my site.

Login code [this is the brains (or insides) of my login code]

[code=php]
<?
/**
* Main.php
*
* This is an example of the main page of a website. Here
* users will be able to login. However, like on most sites
* the login form doesn’t just have to be on the main page,
* but re-appear on subsequent pages, depending on whether
* the user has logged in or not.
*
* Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC)
* Last Updated: August 26, 2004
*/
include(“include/session.php”);
?>

<html>
<title>CYK Studios | Home</title>
<body>

<table>
<tr><td>

<?
/**
* User has already logged in, so display relavent links, including
* a link to the admin center if the user is an administrator.
*/
if($session->logged_in){
echo “<h1>Logged In</h1>”;
echo “Welcome <b>$session->username</b> <br><br>”
.”[<a href=”userinfo.php?user=$session->username”>My Account</a>] &nbsp;&nbsp;”
.”[<a href=”useredit.php”>Edit Account</a>] &nbsp;&nbsp;”;
if($session->isAdmin()){
echo “[<a href=”admin/admin.php”>Admin Center</a>] &nbsp;&nbsp;”;
}
echo “[<a href=”process.php”>Logout</a>]”;
}
else{
?>

<h1>Login</h1>
<?
/**
* User not logged in, display the login form.
* If user has already tried to login, but errors were
* found, display the total number of errors.
* If errors occurred, they will be displayed.
*/
if($form->num_errors > 0){
echo “<font size=”2″ color=”#ff0000″>”.$form->num_errors.” error(s) found</font>”;
}
?>
<form action=”process.php” method=”POST”>
<table align=”left” border=”0″ cellspacing=”0″ cellpadding=”3″>
<tr><td>Username:</td><td><input type=”text” name=”user” maxlength=”30″ value=”<? echo $form->value(“user”); ?>”></td><td><? echo $form->error(“user”); ?></td></tr>
<tr><td>Password:</td><td><input type=”password” name=”pass” maxlength=”30″ value=”<? echo $form->value(“pass”); ?>”></td><td><? echo $form->error(“pass”); ?></td></tr>
<tr><td colspan=”2″ align=”left”><input type=”checkbox” name=”remember” <? if($form->value(“remember”) != “”){ echo “checked”; } ?>>
<font size=”2″>Remember me &nbsp;&nbsp;&nbsp;&nbsp;
<input type=”hidden” name=”sublogin” value=”1″>
<input type=”submit” value=”Login”></td></tr>
<tr><td colspan=”2″ align=”left”><br><font size=”2″>[<a href=”forgotpass.php”>Forgot Password?</a>]</font></td><td align=”right”></td></tr>
<tr><td colspan=”2″ align=”left”><br>
Not registered? <a href=”register.php”>Sign-Up</a></td>
</tr>
</table>
</form>

<?
}

/**
* Just a little page footer, tells how many registered members
* there are, how many users currently logged in and viewing site,
* and how many guests viewing site. Active users are displayed,
* with link to their user information.
*/
echo “</td></tr><tr><td align=”center”><br><br>”;
echo “<b>Member Total:</b> “.$database->getNumMembers().”<br>”;
echo “There are $database->num_active_users registered members and “;
echo “$database->num_active_guests guests viewing the site.<br><br>”;

include(“include/view_active.php”);

?>

</td></tr>
</table>

</body>
</html>
[/code]

login section on my site [this is the design & layout of my login section]

[code=php]
<!–Login Background Starts –>
<div id=”login-bg”>
<!–Login Area Starts –>
<div id=”login-area”>
<form action=”process.php” method=”post” name=”Login” id=”Login”>
<label>Members Login:</label>
<div align=”center”>
<input name=”user” type=”text” id=”user” value=”username” maxlength=”32″ />
<input name=”pass” type=”password” id=”pass” value=”password” maxlength=”32″ />
<input name=”Submit” type=”submit” class=”login-btn” title=”Login” value=”Login” src=”images/login-btn.gif” alt=”Login” />
<br class=”spacer” />
<span class=”style1″> Remember Me | <a href=”forgotpass.php”>Forgot Password?</a></span></div>
</form>
</div>
<!–Login Area Ends –>
</div>
<!–Login Background Ends –>
[/code]

Also i recommend viewing this link [[url]http://cykstudios.exofire.net/][/url] as well, its my header and what i want the design to look like.
if you dont understand what i am asking for, i want the first code to be integrated [combined] with the second code.

Any help at all is very much appreciated!!!

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @Rufus65 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...