/    Sign up×
Community /Pin to ProfileBookmark

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.

to post a comment
PHP

12 Comments(s)

Copy linkTweet thisAlerts:
@ginerjmJul 10.2013 — 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! ?
Copy linkTweet thisAlerts:
@TheQuantumBrosauthorJul 10.2013 — Start over and work on one thing at a time. Show us what you have at each stage if you have a problem.[/QUOTE]

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?
Copy linkTweet thisAlerts:
@ginerjmJul 10.2013 — get a book or do some research on the web instead of just asking us to do your work. Or don't use PHP.
Copy linkTweet thisAlerts:
@TheQuantumBrosauthorJul 11.2013 — 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.
Copy linkTweet thisAlerts:
@MarPloJul 11.2013 — 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: [U][B][url=http://coursesweb.net/php-mysql/register-login-script-users-online_s2]Script users Register, Login, Online[/url][/B][/U] , it has user profile page, and options to log in with Facebook, Google or Yahoo account.
Copy linkTweet thisAlerts:
@TheQuantumBrosauthorJul 11.2013 — 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: [U][B][url=http://coursesweb.net/php-mysql/register-login-script-users-online_s2]Script users Register, Login, Online[/url][/B][/U] , it has user profile page, and options to log in with Facebook, Google or Yahoo account.[/QUOTE]


Thank you, this is what I was looking for, an example of the code that I can customize to fit my needs, thank you.
Copy linkTweet thisAlerts:
@TheQuantumBrosauthorJul 11.2013 — 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: [U][B][url=http://coursesweb.net/php-mysql/register-login-script-users-online_s2]Script users Register, Login, Online[/url][/B][/U] , it has user profile page, and options to log in with Facebook, Google or Yahoo account.[/QUOTE]


On the one you gave me, where is the html part of the registration form, like the actual form part?
Copy linkTweet thisAlerts:
@MarPloJul 12.2013 — The registration form is set in the setFormReg() function, in the "class.UsersReg.php" file; in "usrincls/" folder.
Copy linkTweet thisAlerts:
@TheQuantumBrosauthorJul 12.2013 — Fatal error: Class 'Users' not found in /home/username/public_html/usrincls/class.UsersReg.php on line 3??
Copy linkTweet thisAlerts:
@saiedu168Nov 27.2013 — Hello everyone..

I'm unable to create login/password/registration form for my dynamic website. Can u please help me out??
Copy linkTweet thisAlerts:
@priyankagoundNov 28.2013 — Hello everyone..

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


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.
Copy linkTweet thisAlerts:
@saiedu168Nov 28.2013 — Still.. I'm unable to do it.. Lots of fatal errors
×

Success!

Help @TheQuantumBros 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,
)...