PHP/MySQL Registration Page

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default PHP/MySQL Registration Page

    I have created a registration page that checks for a unique username before
    submitting the users info. If a username is found an error it thrown, telling
    the user what has happened - then provides a link back to the previous page.
    PROBLEM: All the users information is lost when they return to the previous
    page and they have to enter everything again. I have tried the following to
    prevent this from happening. 1: Link back to the page by name 2: Link back to
    the page by Javascript (history.go) 3: Thrown the error on the originating page
    4: Thrown the error on a second page 5: Standard PHP/MySQL Server behaviour
    Does anyone know how to throw the error - then re-direct back to the
    registration without losing all the info? Any help would be appreciated. Sean

    budeborton Guest

  2. Similar Questions and Discussions

    1. Creating a Login / Registration Page
      Can someone please direct me to an article, website or any other data which will help me with this topic: I have a family website and my wife...
    2. code for basic registration to secure page
      hello there I know that this already exists, I just need to find the snippet or formated codes and where they are located. thanks
    3. Registration page into database
      Hi all, Im doing a registration page for site visitors but I cant connect the registration page and the databse. I have a primary key in the...
    4. Registration Page
      Hi all, Im doing a registration page for site visitors but I cant connect the registration page and the databse. I have a primary key in the...
    5. Forms autentication and registration page - some advices
      Hi, I implement forms authentication in my application. So I have a login form. Actually I have two custom Web controls, one to login and one to...
  3. #2

    Default Re: PHP/MySQL Registration Page

    What you need to do is on the first page after the form is submitted is write
    all the values to session variables. Then when you go back to the form after an
    error, you can reinsert the values from the session into the form. If you're
    not sure about how to do this, post your code and i'll show you how it's
    done.....

    Ross Riley Guest

  4. #3

    Default Re: PHP/MySQL Registration Page

    budeborton wrote:
    > Does anyone know how to throw the error - then re-direct back to the
    > registration without losing all the info? Any help would be appreciated. Sean
    Create a self-processing page, using $_SERVER['PHP_SELF'] for the action
    attribute in the form.

    At the top of the page, create a conditional statement to test whether
    the POST array has been set:

    if ($_POST) {
    // check details here
    // if OK enter into database
    // if not, set error variable ($error = true)
    }

    In the body of the document. Test for POST and $error. If both true,
    redisplay the content of the field:

    if ($_POST && $error) {
    echo $_POST['username'];
    }

    That's a very rough outline, omitting all the HTML, but the principle
    should be clear.

    --
    David Powers
    Author, "Foundation PHP 5 for Flash" (friends of ED)
    Co-author "PHP Web Development with DW MX 2004" (Apress)
    [url]http://computerbookshelf.com[/url]
    David Powers Guest

  5. #4

    Default Re: PHP/MySQL Registration Page

    I kind of figured I would have to reload the form from variables. I'm not sure why I thought there would be an easier solution - but if there isn't I can work with what you both have stated.

    Thanks
    budeborton Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139