+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: working with a PHP login system script...

  1. #1
    rufussweetwater's Avatar
    rufussweetwater is offline x10Hosting Member rufussweetwater is an unknown quantity at this point
    Join Date
    May 2009
    Location
    IN, USA
    Posts
    56

    Exclamation working with a PHP login system script...

    :dunno:I am not at all a good coder to say for this problem, just warning you now.:nuts:

    I was browsing Google for a nice PHP based login script for my site and i found Evolt.org.:eek4: I read through the page and it had some very good reviews/comments and everything, but i need to know these main things:

    1] how do i integrate them with my site?? :dunnoReally need help at this point, i'm freaking confused...)

    2] where do i put the files so i can upload them on the server correctly?

    here's a link to the files the site was talking about and that i have to work with.
    Or you can download the attachment: :lockd::Login System v.2.0 PHP Scripts::lockd:

    :hsugh:Any help at all would be much appreciated.:fingersx:
    Attached Files
    Last edited by rufussweetwater; 06-29-2009 at 09:04 PM. Reason: ...spellcheck...

    :hahano: Don't Laugh, I'm not a hard gamer... :hahano:

    ................I Know................
    :wavey: $====> CYK Studios <====$ :lockd:
    Movies, Games, Reviews, & More...

  2. #2
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: working with a PHP login system script...

    Your files should go in /home/{your user name}/public_html

    you need to unzip the files. Using the MySQL databases wizard, create a database and user (call them whatever you want. note however, that uses and databases will start with your cpanel user name, ie "db" is really "garrett_db" and "user" is really "garrett_user". this is done automatically for you)

    Now, using PHPMyAdmin, you need to select your database, then use IMPORT to import the datatables.sql file.

    Integration is through main.php. You need to provide a link to this file so your users can log in. You can access a user's information using the $_SESSION superglobal, IE $_SESSION['username'].
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  3. #3
    rufussweetwater's Avatar
    rufussweetwater is offline x10Hosting Member rufussweetwater is an unknown quantity at this point
    Join Date
    May 2009
    Location
    IN, USA
    Posts
    56

    Re: working with a PHP login system script...

    thanks, but i don't think i went into much detail, i got the datatables.sql imported and that's running fine, but how do i make the link between my already made username and password boxes and the main.php file as well as the sign up button while still keeping my style the same?
    Last edited by rufussweetwater; 06-29-2009 at 09:09 PM. Reason: additional info...

    :hahano: Don't Laugh, I'm not a hard gamer... :hahano:

    ................I Know................
    :wavey: $====> CYK Studios <====$ :lockd:
    Movies, Games, Reviews, & More...

  4. #4
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: working with a PHP login system script...

    The trick will be to modify the code from main.php. Make sure you include('session.php');

    Code:
    <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 next time     
    <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>
    You'll have to change your inputs to look like this.
    Last edited by garrettroyce; 06-29-2009 at 09:45 PM.
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  5. #5
    rufussweetwater's Avatar
    rufussweetwater is offline x10Hosting Member rufussweetwater is an unknown quantity at this point
    Join Date
    May 2009
    Location
    IN, USA
    Posts
    56

    Exclamation Re: working with a PHP login system script...

    Okay, here's what I have right now the design style code in my index.html file:
    Code:
    <!--Login Background Starts -->
    <div id="login-bg">
    <!--Login Area Starts -->
    <div id="login-area">
    <form action="" method="post" name="Login" id="Login">
    <label>Members Login:</label>
    <input name="username" type="text" id="username" value="username" maxlength="30" />
    <input name="pass" type="password" id="pass" value="password" maxlength="30" />
    <input type="image" src="http://forums.x10hosting.com/images/login-btn.gif" class="login-btn" alt="Login" title="Login" />
    <br class="spacer" />
    </form>
    </div>
    <!--Login Area Ends -->
    </div>
    <!--Login Background Ends -->
    and here's the code i need to merge with to make the link possible while keeping my design the same:

    Code:
    <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>
    i have no clue on how to do any of this... so im getting really confused now:dunno:. basically your telling me to establish a link with the table or the individual boxes [i.e. username & password box and the login and the sign up box] with the main.php file? if so then i need help merging or whatever it is between those two elements. the code you posted i put into dreamweaver and it looks very similar to my main.php only it doesn't have the password fields or the login label, so i do know we should be on the same page...
    Last edited by rufussweetwater; 06-29-2009 at 10:05 PM. Reason: additional info...

    :hahano: Don't Laugh, I'm not a hard gamer... :hahano:

    ................I Know................
    :wavey: $====> CYK Studios <====$ :lockd:
    Movies, Games, Reviews, & More...

  6. #6
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: working with a PHP login system script...

    I think I successfully merged the two parts of the code for you:

    Code:
    <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>";
    }
    ?>
    <!--Login Background Starts -->
    <div id="login-bg">
    <!--Login Area Starts -->
    <div id="login-area">
    <form action="process.php" method="POST">
    Username:<input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"><? echo $form->error("user"); ?>
    Password:</td><td><input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"><? echo $form->error("pass"); ?>
    <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="image" src="http://forums.x10hosting.com/images/login-btn.gif" class="login-btn" alt="Login" title="Login" />
    <br class="spacer" />
    <font size="2">[<a href="forgotpass.php">Forgot Password?</a>]</font>
    Not registered? <a href="register.php">Sign-Up</a>
    </form>
    </div>
    <!--Login Area Ends -->
    </div>
    <!--Login Background Ends -->
    </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>
    You may have to tweak it a little. I'm tired and I don't have the entire page to look at ;)

    Nice buckethead picture, btw
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  7. #7
    rufussweetwater's Avatar
    rufussweetwater is offline x10Hosting Member rufussweetwater is an unknown quantity at this point
    Join Date
    May 2009
    Location
    IN, USA
    Posts
    56

    Exclamation Re: working with a PHP login system script...

    thanks, buckethead's a great guitar player.

    anyways, i tried your new code and i mangled with it, but i still couldn't get it to work, i now understand how to establish the links, but i don't know how to link the username and password boxes and login picture as well. I got the sign up picture linked to the register.php script but i'm still messing up the links with the usename and password boxes. Here's the code for my entire header all the way up to my sign up button. i'll let you take a look at that and we can go from there...

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>CYK Studios | Home</title>
    <link href="style.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    <!--
    .style1 {
    	color: #FCF7CC;
    	font-weight: bold;
    	font-size: x-small;
    }
    .style2 {color: #4B1A15}
    -->
    </style>
    </head>
    
    <body>
    <!--Header Background Part Starts -->
    <div id="header-bg">
    	<!--Header Contant Part Starts -->
    	<div id="header">
    		<a href="index.html" target="_parent"><img src="http://forums.x10hosting.com/images/logo.gif" alt="CYK Studios" name="logo" width="281" height="62" class="logo" id="logo" title="CYK Studios" /></a>
    		<!--Login Background Starts -->
    <div id="login-bg">
    			<!--Login Area Starts -->
    			<div id="login-area">
    				<form action="" method="post" name="Login" id="Login">
    					<label>Members Login:</label>
    					<div align="center">
    					  <input name="username" type="text" id="username" value="username" maxlength="30" />
    					  <input name="pass" type="password" id="pass" value="password" maxlength="30" />
    					  <input type="image" src="http://forums.x10hosting.com/images/login-btn.gif" class="login-btn" alt="Login" title="Login" />
    					  <br class="spacer" />
    					  <span class="style1"><span class="style2">______________________</span>Remember Me | <a href="forgotpass.php">Forgot Password?</a></span></div>
    			  </form>
    			</div>
    			<!--Login Area Ends -->
    		</div>
    		<!--Login Background Ends -->
    		<br class="spacer" />
    	</div>
      <!--Header Contant Part Ends -->
    </div>
    <!--Header Background Part Ends -->
    <!--Navigation Background Part Starts -->
    <div id="navigation-bg">
    	<!--Navigation Part Starts -->
    	<div id="navigation">
    		<ul class="mainMenu">
    			<li><a href="index.html" class="selectMenu">Home</a></li>
    			<li><a href="videos.html">Videos</a></li>
    		  <li><a href="#">Archives</a></li>
    			<li><a href="#">Forums</a></li>
    			<li><a href="#">Podcasts</a></li>
    			<li><a href="#">Downloads</a></li>
    			<li class="noBg"><a href="#">Contact Us</a></li>
    		</ul>
    		<a href="register.php" class="signup"></a>
    	  <br class="spacer" />
    		<ul class="subNav">
    			<li class="noBg"></li>
    		  <li></li>
    		  <li></li>
    		  <li></li>
    		  <li></li>
    		  <li></li>
    		  <li></li>
    		  <li></li>
    	  </ul>
    		<br class="spacer" />
    	</div>
    	<!--Navigation Part Ends -->
    </div>
    <!--Navigation Background Part Ends -->
    P.S. Thanks for all the help you've given me, i really appreciate it.
    Last edited by rufussweetwater; 06-30-2009 at 10:03 AM.

    :hahano: Don't Laugh, I'm not a hard gamer... :hahano:

    ................I Know................
    :wavey: $====> CYK Studios <====$ :lockd:
    Movies, Games, Reviews, & More...

  8. #8
    espfutbol98's Avatar
    espfutbol98 is offline x10 Sophmore espfutbol98 is an unknown quantity at this point
    Join Date
    Apr 2009
    Location
    Zagreb... želim
    Posts
    200

    Re: working with a PHP login system script...

    I'm not exactly sure what your problem is but when you integrate scripts with forms, the only important things are: you must have the "name", it must be the same type of input, and within a proper "form", and that's really all. "Class" and "id" are mostly for css. Hope that helps.

  9. #9
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: working with a PHP login system script...

    Ah, you can't change the name attribute of the inputs or you will break the link. Make sure you copy them exactly from the code given in main.php. I'm sorry if I copied it wrong, like I said, I was really tired :P
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  10. #10
    rufussweetwater's Avatar
    rufussweetwater is offline x10Hosting Member rufussweetwater is an unknown quantity at this point
    Join Date
    May 2009
    Location
    IN, USA
    Posts
    56

    Exclamation Re: working with a PHP login system script...

    So what exactly do i copy from the main.php? and where do i paste it in?

    Here's all i'm trying to do. This is a picture of my header containing the members login section along with the signup button. I don't care if i use the same PHP code i have now, all i want is some sort of PHP code that will allow me to make this login section functioning and stay this way.
    Attached Images
    Last edited by rufussweetwater; 06-30-2009 at 08:40 PM.

    :hahano: Don't Laugh, I'm not a hard gamer... :hahano:

    ................I Know................
    :wavey: $====> CYK Studios <====$ :lockd:
    Movies, Games, Reviews, & More...

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. How to: Member Login System with PHP
    By tttony in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 02-12-2009, 04:51 PM
  2. php login script
    By matt1213 in forum Scripts & 3rd Party Apps
    Replies: 3
    Last Post: 12-03-2008, 08:31 AM
  3. Login script 1k credits
    By Daniel S in forum The Marketplace
    Replies: 7
    Last Post: 08-22-2008, 03:10 PM
  4. PHP script not working (RSSgenr8.php)
    By deepwater in forum Free Hosting
    Replies: 8
    Last Post: 09-13-2007, 11:14 PM
  5. PHP login script
    By xunhandmex in forum Scripts & 3rd Party Apps
    Replies: 8
    Last Post: 05-26-2005, 07:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers