Could somebody help me out on the following:

I am building a website in which I will require
visitors to create an account by filling out some web
forms. My problems now are three:

  1. I want data entered in the form fields be submitted to
    a PHP MySQL database.

  2. As soon as the form is submitted I want
    auto-response sent to the email address of the visitor
    in form of acknowledgement. This email address will be
    the visitors user name.

  3. When the above is done will it be possible for the
    visiter to automatically login to his account?

Someone help. Thanks.

    Thanks for your help. Actually am new to database. I would be happy if you can give me a little format of how to begin from the html form to the connection stage with the php mysql database.

      <?PHP
      if ($_SERVER['REQUEST_METHOD'] == "POST" && isset($_POST['submit'])) {
         $name= $_POST['user_name'];
         $email = $_POST['user_email'];
         // mysql_connect() here
         $sql = 'INSERT INTO users username, email VALUES ("'.mysql_real_escape_string($name).'", "'.mysql_real_escape_string($email).'");';
         $result = mysql_query($sql);
         // error checking here for the returned result
         mail($email, 'Welcome!', 'Message', $headers); // or whatever you want here
         // set the $_SESSION['logged_in'] variable to true, or however you flag users
         // as logged in
      ?>
      

      Also, please use the board to ask questions in the future, not the contact form on our personal websites. The board allows other people with the same problem to look it up in the future, preventing the same questions over and over again (in theory).
      }

        Thanks for your help. I will try it out.

          I 've not really been able to know where to place the php mysql codes. The whole thing is a bit confusing to me. I am very new to database, I am used to designing forms in html, that is, webmail. Integrating databsae now to achive the three objectives I want is hard to me. Below is the form I designed in html. Could you tell me what to do now to acive the three objectives:
          1. To enable a site visitor create an account and have the data entered in the form fields be submitted to a PHP MySQL database.

          1. As soon as the form is submitted I want
            auto-response sent to the email address of the visitor
            in form of acknowledgement. This email address will be
            the visitors user name.

          2. When the above is done will it be possible for the
            visiter to automatically login to his account?

          <html>

          <head>
          <title>Create an account</title>
          </head>

          <body>
          <p><font face="Arial" style="font-size: 9pt" color="#505050">
          Create a new account with us.</font></p>
          <table border="0" cellpadding="0" cellspacing="0" width="346" id="table126"><tr><td width="346">
          <font face="Arial" style="font-size: 9pt">
          First Name:</font><o:p><input name="FName" size="24" style="font-family: Arial; font-size: 9pt"><font face="Arial" style="font-size: 9pt"><br>
          Last Name:</font><o:p><input name="LName" size="24" style="font-family: Arial; font-size: 9pt"><font face="Arial" style="font-size: 9pt"><br>
          Company:</font><font face="Arial"><span style="font-size: 9pt"><input type="text" name="Company" size="20" style="font-family: Arial; font-size: 10pt"></span></font><font face="Arial" style="font-size: 9pt"><br>
          Address1:</font><font face="Arial"><span style="font-size: 9pt"><input type="text" name="Address1" size="20" style="font-family: Arial; font-size: 10pt"></span></font><font face="Arial" style="font-size: 9pt"><br>
          Address2:</font><font face="Arial"><span style="font-size: 9pt"><input type="text" name="Address2" size="20" style="font-family: Arial; font-size: 10pt"></span></font><font face="Arial" style="font-size: 9pt"><br>
          Telephone:</font><font face="Arial"><span style="font-size: 9pt"><input type="text" name="Telephone" size="20" style="font-family: Arial; font-size: 10pt"></span></font><font face="Arial" style="font-size: 9pt"><br>
          Your Email:</font><font face="Arial"><span style="font-size: 9pt"><input type="text" name="email" size="20" style="font-family: Arial; font-size: 10pt"></span></font><font style="font-size: 9pt" face="Arial"><br>
          Re-Enter Email:</font><font face="Arial"><span style="font-size: 9pt"><input type="text" name="Confirm_Email" size="20" style="font-family: Arial; "></span></font><font face="Arial" style="font-size: 9pt"><br>
          Password:</font><font face="Arial"><span style="font-size: 9pt"><input type="password" name="Password" size="20" style="font-family: Arial; font-size: 10pt"></span></font><font face="Arial" style="font-size: 9pt"><br>
          Confirm Password:</font><font face="Arial"><span style="font-size: 9pt"><input type="password" name="Confirm_password" size="20" style="font-family: Arial; font-size: 10pt"><br>
          <input type="submit" value="Continue" style="color: #FF0000; font-family: Arial; "></span></font></td>
          </tr></table>
          </body></html>

          Someone help. Thanks.

            Write a Reply...