www.webdeveloper.com
Results 1 to 13 of 13

Thread: PHP/HTML Registration/Login/Profiles

  1. #1
    Join Date
    Jul 2013
    Posts
    6

    Question PHP/HTML Registration/Login/Profiles

    I have been trying to make a registration/login/profiles but my code is so jacked up I have given up trying to do it on my own, so can anyone give me a helping hand? The things I want it to include are a registration (where if an error is preformed on the submit, it will show an error message without sending them to a new page), login areas, and profiles. I also want it to use MySQLi to insert the profile data into an SQL table. And lastly, I want it to send the user and email to verify their email address. So how do I accomplish all of this? Thanks in advanced.

  2. #2
    Join Date
    Jul 2013
    Location
    Voorheesville NY USA
    Posts
    790
    Start over and work on one thing at a time. Show us what you have at each stage if you have a problem.

    And thank you for NOT posting your 'jacked up' code!

  3. #3
    Join Date
    Jul 2013
    Posts
    6

    Question Where to start?

    Quote Originally Posted by ginerjm View Post
    Start over and work on one thing at a time. Show us what you have at each stage if you have a problem.
    I have no clue where to start, I'm horrible at PHP and using it with HTML. I don't know where to put the PHP in comparison to the HTML, I don't know how to display the error messages, if I could get the registration figured out I can probably figure the rest out on my own. So any ideas on what I should do? Or how to form it?

  4. #4
    Join Date
    Jul 2013
    Location
    Voorheesville NY USA
    Posts
    790
    get a book or do some research on the web instead of just asking us to do your work. Or don't use PHP.

  5. #5
    Join Date
    Jul 2013
    Posts
    6
    Then what would be a better way to do it instead of PHP that would put it into a database? And I'm not just asking you to do my work, I'm asking where to start or where an example would be so I can fix mine.

  6. #6
    Join Date
    Feb 2011
    Posts
    231
    Hi,
    To make a register /login script, with user profile page, needs some php programming experience. But if you know a little php, you can use a script found on the net. Just look for: "free php register login sacript".
    I recommend this script: Script users Register, Login, Online , it has user profile page, and options to log in with Facebook, Google or Yahoo account.
    Last edited by MarPlo; 07-11-2013 at 12:39 AM.

  7. #7
    Join Date
    Jul 2013
    Posts
    6
    Quote Originally Posted by MarPlo View Post
    Hi,
    To make a register /login script, with user profile page, needs some php programming experience. But if you know a little php, you can use a script found on the net. Just look for: "free php register login sacript".
    I recommend this script: Script users Register, Login, Online , it has user profile page, and options to log in with Facebook, Google or Yahoo account.
    Thank you, this is what I was looking for, an example of the code that I can customize to fit my needs, thank you.

  8. #8
    Join Date
    Jul 2013
    Posts
    6
    Quote Originally Posted by MarPlo View Post
    Hi,
    To make a register /login script, with user profile page, needs some php programming experience. But if you know a little php, you can use a script found on the net. Just look for: "free php register login sacript".
    I recommend this script: Script users Register, Login, Online , it has user profile page, and options to log in with Facebook, Google or Yahoo account.
    On the one you gave me, where is the html part of the registration form, like the actual form part?

  9. #9
    Join Date
    Feb 2011
    Posts
    231
    The registration form is set in the setFormReg() function, in the "class.UsersReg.php" file; in "usrincls/" folder.

  10. #10
    Join Date
    Jul 2013
    Posts
    6
    Fatal error: Class 'Users' not found in /home/username/public_html/usrincls/class.UsersReg.php on line 3??

  11. #11
    Join Date
    Nov 2013
    Location
    Hyderabad, A.P, India
    Posts
    2
    Hello everyone..

    I'm unable to create login/password/registration form for my dynamic website. Can u please help me out??

  12. #12
    Join Date
    Sep 2013
    Posts
    221
    Hello everyone..

    I'm unable to create login/password/registration form for my dynamic website. Can u please help me out??
    Here is an example code below:
    <div id="login-register-password">

    <?php global $user_ID, $user_identity; get_currentuserinfo(); if (!$user_ID) { ?>

    <ul class="tabs_login">
    <li class="active_login"><a href="#tab1_login">Login</a></li>
    <li><a href="#tab2_login">Register</a></li>
    <li><a href="#tab3_login">Forgot?</a></li>
    </ul>
    <div class="tab_container_login">
    <div id="tab1_login" class="tab_content_login">

    <?php $register = $_GET['register']; $reset = $_GET['reset']; if ($register == true) { ?>

    <h3>Success!</h3>
    <p>Check your email for the password and then return to log in.</p>

    <?php } elseif ($reset == true) { ?>

    <h3>Success!</h3>
    <p>Check your email to reset your password.</p>

    <?php } else { ?>

    <h3>Have an account?</h3>
    <p>Log in or sign up! It&rsquo;s fast &amp; <em>free!</em></p>

    <?php } ?>

    <form method="post" action="<?php bloginfo('url') ?>/wp-login.php" class="wp-user-form">
    <div class="username">
    <label for="user_login"><?php _e('Username'); ?>: </label>
    <input type="text" name="log" value="<?php echo esc_attr(stripslashes($user_login)); ?>" size="20" id="user_login" tabindex="11" />
    </div>
    <div class="password">
    <label for="user_pass"><?php _e('Password'); ?>: </label>
    <input type="password" name="pwd" value="" size="20" id="user_pass" tabindex="12" />
    </div>
    <div class="login_fields">
    <div class="rememberme">
    <label for="rememberme">
    <input type="checkbox" name="rememberme" value="forever" checked="checked" id="rememberme" tabindex="13" /> Remember me
    </label>
    </div>
    <?php do_action('login_form'); ?>
    <input type="submit" name="user-submit" value="<?php _e('Login'); ?>" tabindex="14" class="user-submit" />
    <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />
    <input type="hidden" name="user-cookie" value="1" />
    </div>
    </form>
    </div>
    <div id="tab2_login" class="tab_content_login" style="display:none;">
    <h3>Register for this site!</h3>
    <p>Sign up now for the good stuff.</p>
    <form method="post" action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>" class="wp-user-form">
    <div class="username">
    <label for="user_login"><?php _e('Username'); ?>: </label>
    <input type="text" name="user_login" value="<?php echo esc_attr(stripslashes($user_login)); ?>" size="20" id="user_login" tabindex="101" />
    </div>
    <div class="password">
    <label for="user_email"><?php _e('Your Email'); ?>: </label>
    <input type="text" name="user_email" value="<?php echo esc_attr(stripslashes($user_email)); ?>" size="25" id="user_email" tabindex="102" />
    </div>
    <div class="login_fields">
    <?php do_action('register_form'); ?>
    <input type="submit" name="user-submit" value="<?php _e('Sign up!'); ?>" class="user-submit" tabindex="103" />
    <?php $register = $_GET['register']; if($register == true) { echo '<p>Check your email for the password!</p>'; } ?>
    <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>?register=true" />
    <input type="hidden" name="user-cookie" value="1" />
    </div>
    </form>
    </div>
    <div id="tab3_login" class="tab_content_login" style="display:none;">
    <h3>Lose something?</h3>
    <p>Enter your username or email to reset your password.</p>
    <form method="post" action="<?php echo site_url('wp-login.php?action=lostpassword', 'login_post') ?>" class="wp-user-form">
    <div class="username">
    <label for="user_login" class="hide"><?php _e('Username or Email'); ?>: </label>
    <input type="text" name="user_login" value="" size="20" id="user_login" tabindex="1001" />
    </div>
    <div class="login_fields">
    <?php do_action('login_form', 'resetpass'); ?>
    <input type="submit" name="user-submit" value="<?php _e('Reset my password'); ?>" class="user-submit" tabindex="1002" />
    <?php $reset = $_GET['reset']; if($reset == true) { echo '<p>A message will be sent to your email address.</p>'; } ?>
    <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>?reset=true" />
    <input type="hidden" name="user-cookie" value="1" />
    </div>
    </form>
    </div>
    </div>

    <?php } else { // is logged in ?>

    <div class="sidebox">
    <h3>Welcome, <?php echo $user_identity; ?></h3>
    <div class="usericon">
    <?php global $userdata; get_currentuserinfo(); echo get_avatar($userdata->ID, 60); ?>

    </div>
    <div class="userinfo">
    <p>You&rsquo;re logged in as <strong><?php echo $user_identity; ?></strong></p>
    <p>
    <a href="<?php echo wp_logout_url('index.php'); ?>">Log out</a> |
    <?php if (current_user_can('manage_options')) {
    echo '<a href="' . admin_url() . '">' . __('Admin') . '</a>'; } else {
    echo '<a href="' . admin_url() . 'profile.php">' . __('Profile') . '</a>'; } ?>

    </p>
    </div>
    </div>

    <?php } ?>

    </div>

    I have used the above code in one of my application and it has worked great for me.
    Hope this helps.
    strad solutionswww.stradsolutions.com

  13. #13
    Join Date
    Nov 2013
    Location
    Hyderabad, A.P, India
    Posts
    2
    Still.. I'm unable to do it.. Lots of fatal errors

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles