0

私は user-register.tpl.php ファイルを作成しました。そして、その中に多くのテキストフィールドを設定しました。
しかし、今はそれが必要です....
ユーザー情報をデータベースに保存したいのです。bcz カスタマイズした登録ページを作成したので、テキスト フィールドの値をデータベースに保存する必要があります。
このような.......

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

ここで、この myuser テキスト フィールドに入力されるユーザー名を保存します。



ティッシュ・パンチジャンヤ・コーポレーション

4

1 に答える 1

-1
<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 } ?>
于 2010-05-01T06:46:19.873 に答える