Results 1 to 4 of 4

Thread: Register Problem

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2008
    Posts
    297

    Register Problem

    Hi im trying to make a website and I want people to register to my site. So I made a registration form (in php duh) and the design is good, but now is the coding part.

    PHP Code:
    <div id="reg">
                        <p>
                            In order to be able to gain access to the UFC stream, you must first register. Please
                            enter your desired user name, your email address and other required details in the
                            form below.</p>
                        <form action="" method="post">
                        <p>
                            <strong>User Name:</strong><br />
                            <input name="user" type="text" size="50" />
                        </p>
                        <fieldset style="width: 100%;">
                            <legend>Password</legend>
                            <table style="text-align: left;" cellpadding="0">
                                <tr>
                                    <td colspan="2">
                                        Please enter a password for your user account. Note that passwords are case-sensitive.
                                    </td>
                                </tr>
                                <tr>
                                    <td width="186">
                                        Password:
                                    </td>
                                    <td width="319">
                                        Confirm Password:
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <input name="pass" type="password" size="30" />
                                    </td>
                                    <td>
                                        <input name="pass_again" type="password" size="30" />
                                    </td>
                                </tr>
                            </table>
                        </fieldset>
                        <br />
                        <fieldset style="width: 100%;">
                            <legend>Email Address</legend>
                            <table style="text-align: left;" cellpadding="0">
                                <tr>
                                    <td colspan="2">
                                        Please enter a valid email address for yourself.
                                    </td>
                                </tr>
                                <tr>
                                    <td width="186">
                                        Email Address::
                                    </td>
                                    <td width="319">
                                        Confirm Email Address:
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <input name="email" type="text" size="30" id="email" />
                                  </td>
                                    <td>
                                        <input name="email_again" type="text" size="30" id="email_again" />
                                    </td>
                                </tr>
                            </table>
                        </fieldset>
                        <br />
                        <fieldset style="width: 100%;">
                            <legend>Captcha Verification</legend>
                            <?
                                require_once('captcha/recaptchalib.php');
                                $publickey = "6Lev0roSAAAAAPmNWWtRTbeLzmCHMuIQz7Ly4Wop "; // you got this from the signup page
                                echo recaptcha_get_html($publickey);
                            ?>
                        </fieldset>
                        <br />
                        <center>
                            <input type="submit" value="Complete Registration" class="button"/>
                            <input type="reset" value="Reset Fields" name="Reset" class="button" />
                        </center>
                        </form>
                    </div>
    thats the login area, you can take a look at it live here

    http://www.smartinuzzi.com/register.php

    Right now there is no validation and I want to add some basic validation.

    How can I validate if the password and password_conf is the same?
    I don't want a page to open, I need a popup saying "password must be the same" like the javascript ALERT fundtion.

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: Register Problem

    if you want JavaScript validation, you may be better off posting here.

    also, the link you posted doesn't work.

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Register Problem

    Client-side validation is all well and good, but remember to always validate everything on the server side as well. Assume no validation took place on the client at all, because it might not have. I write client-side stuff last because it's a mere convenience.

    There are lots of tutorials on the basics of user registration and authentication around.

  4. #4
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    Re: Register Problem

    Most ppl use javascript in order to validate if both passwords are the same but even if you do so, do not forget to check on serverside if both passwords are actually equal. A lot of ppl turn off java and javascript for security reasons most of times.

    Here is a detailed and well explained tutorial:
    http://www.devshed.com/c/a/PHP/Creat...-Login-Script/
    and here
    http://php.about.com/od/finishedphp1...login_code.htm
    and here
    http://www.phpeasystep.com/workshopview.php?id=6

    google is your friend but have a look at php.net also
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

Posting Permissions

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



Click Here to Expand Forum to Full Width