Search code examples
phpdrupal-6drupal-fapiuser-registration

Customized User Registration Form


i have made user-register.tpl.php file. And i have set many text field in that.
But now i need that....
i want to store the users information to the database. bcz i have created the customized registration page, so i need that my text field values should be store in the database.
like this.......

Username:    <input type="text" name="myuser" id="myuser" />

Now i want to store the username, which will entered in this myuser text filed.


Nitish
Panchjanya Corporation


Solution

  • <form action="index.php" method="post" name="acc_info_form">
      Username:    <input type="text" name="myuser" id="myuser" /><br/>
      First Name:    <input type="text" name="name" id="name" /><br/>
      <input  type="submit"  value="Save"/>
    </form>
    

    index.php

       //Here you have to write database connection and then
        <?PHP  if ( $_POST){  ?>
            mysql_query("INSERT INTO users (myuser, name) VALUES('".$_POST['myuser']."',".$_POST['name']."' )") or die(mysql_error());
        <?PHP } ?>