这个你只要看一些html的书就可以了解了。
你搜索一下html
应该可以找到。

解决方案 »

  1.   

    采用数组,可参照如下:
    <input type="checkbox" name="aid[]" value="1">
    ...
    处理程序:
    foreach ($aid as $val) {
        $query = "delete from table where id='$val'";
        mysql_query($query);
    }
      

  2.   

    <?php$hostname='localhost';
    $username='phpuser';
    $password='phpuser';
    $link_id=@mysql_connect($hostname,$username,$password);$arr_request = array();
    //如果采用post方式
    if (count($HTTP_POST_VARS))
    {
    while (list($key, $value) = each ($HTTP_POST_VARS))
    $arr_request[strtolower($key)] = $value;
    }
    //如果采用get方式
    if (count($HTTP_GET_VARS))
    {
    while (list($key, $value) = each ($HTTP_GET_VARS))
    $arr_request[strtolower($key)] = $value;
    }function show_msg($message)
    {
    echo '<table><tr><td>';
    echo "$message";
    echo '</td></tr></table>';
    }function show_title($title)
    {
    echo '<html><head><title>';
    echo "$title";
    echo '</title></head><body>';
    }function show_foot()
    {
    echo '</body></html>';
    }function show_err()
    {
    $errno = mysql_errno(); //得到错误信息代码
    $error = mysql_error(); //得到错误信息内容
    if ($errno)
    {
    show_msg('Error:');
    show_msg($error);
    }
    }function show_dbs()
    {
    $dbs = @mysql_list_dbs();
    $num_dbs = @mysql_numrows($dbs); if (!$num_dbs)
    {
    show_msg("在MySQL中没有任何数据库。");
    }
    else
    {
    show_msg("MySQL中现有如下数据库:");
    $i = 0;
    echo '<table border=2><tr>';
    while ($i < $num_dbs)
    {
    $db=@mysql_tablename($dbs, $i);
    echo '<th>'.$db.'</th>';
    if ($i%3 == 2) echo '</tr><tr>';
    $i++;
    }
    echo '</tr></table>';
    }
    }function select_db($dbname)
    {
    $dbs = @mysql_list_dbs();
    $num_dbs = @mysql_numrows($dbs); $i = 0;
    echo "<table><tr>";
    echo "<td>请选择数据库:</td>";
    echo "<td><select name=$dbname>";
    while ($i < $num_dbs)
    {
    $db = @mysql_tablename($dbs, $i);
    echo "<option value=$db>$db</option>";
    $i++;
    }
    echo '</select></td></tr>';
    echo '<tr><td><input type="submit" value="确定"></td></tr>';
    echo '</table>';
    }function show_tables($dbname)
    {
    $tables = @mysql_list_tables($dbname);
    $num_tables = @mysql_numrows($tables);

    if (!$num_tables)
    {
    show_msg("数据库".$dbname."现在中没有任何列表。");
    }
    else
    {
    show_msg("数据库".$dbname."现有如下列表:");
    $i = 0;
    echo '<table border=2><tr>';
    while ($i < $num_tables)
    {
    $table=@mysql_tablename($tables, $i);
    echo '<td>'.$table.'</td>';
    if ($i%3 == 2)
    echo '</tr><tr>';
    $i++;
    }
    echo '</tr></table>';
    }
    }function select_table($dbname,$tablename)
    {
    $tables = @mysql_list_tables($dbname);
    $num_tables = @mysql_num_rows($tables);

    $i = 0;
    echo "<table><tr>";
    echo "<td>请选择列表:</td>";
    echo "<td><select name=$tablename>";
    while ($i < $num_tables)
    {
    $table = @mysql_tablename($tables, $i);
    echo "<option value=$table>$table</option>";
    $i++;
    }
    echo '</select></td></tr>';
    echo '<tr><td><input type="submit" value="确定"></td></tr>';
    echo '</table>';
    }function show_fields($dbname,$tablename)
    {
    $result = @mysql_db_query($dbname, "show fields from $tablename");
    show_msg("表格".$tablename."现有如下字段:");
    echo '<table border=3>';
    echo '<tr>';
    echo '<th>名称</th>';
    echo '<th>类型</th>';
    echo '<th>空值</th>';
    echo '<th>缺省</th>';
    echo '<th>增量</th>';
    echo '</tr>';
    while ($row = @mysql_fetch_array($result))
    {
    echo '<tr>';
    echo '<td>'.$row["Field"].'</td>';
    echo '<td>'.$row["Type"].'</td>';

    echo '<td>';
    if ($row["Null"] == "") echo 'NOT NULL';
    else echo "NULL";
    echo '</td>';

    echo '<td>';
    if ($row["Default"] == "") echo '无';
    else echo $row["Default"];
    echo '</td>';

    echo '<td>';
    if ($row["Extra"] == "") echo '无';
    else echo '自动';
    echo '</td>';
    echo '</tr>';
    }
    echo '</table>';
    @mysql_free_result($result);
    }function select_field($dbname,$tablename,$fieldname)
    {
    $fields = @mysql_list_fields($dbname,$tablename);
    $num_fields = @mysql_num_fields($fields);
    echo "<table><tr>";
    echo "<td>请选择字段: </td>";
    echo "<td><select name=$fieldname>";
    for ($i=0; $i<$num_fields; $i++)
    {
    $field = @mysql_field_name($fields, $i);
    echo '<option value='.$field.'>'.$field.'</option>';
    }
    echo '</select></td></tr>';
    echo '<tr><td><input type="submit" value="确定"></td></tr>';
    echo '</table>';
    }function insert_fields($num_fields)
    {
    echo '<table border=3>';
    echo '<tr>';
    echo '<th>名称</th>';
    echo '<th>类型</th>';
    echo '<th>长度</th>';
    echo '<th>空值</th>';
    echo '<th>缺省</th>';
    echo '<th>增量</th>';
    echo '</tr>';
    for ($i=0 ; $i<$num_fields; $i++)
    {
    echo '<tr>';
    echo '<td><input type="text" name="field_name[]"></td>'; echo '<td><select name="field_type[]">';
    echo '<option value="tinyint">tinyint</option>';
    echo '<option value="smallint">smallint</option>';
    echo '<option value="mediumint">mediumint</option>';
    echo '<option value="int">int</option>';
    echo '<option value="bigint">bigint</option>';
    echo '<option value="float">float</option>';
    echo '<option value="double">double</option>';
    echo '<option value="decimal">decimal</option>';
    echo '<option value="date">date</option>';
    echo '<option value="datetime">datetime</option>';
    echo '<option value="timestamp">timestamp</option>';
    echo '<option value="time">time</option>';
    echo '<option value="year">year</option>';
    echo '<option value="char">char</option>';
    echo '<option value="varchar">varchar</option>';
    echo '<option value="tinyblob">tinyblob</option>';
    echo '<option value="tinytext">tinytext</option>';
    echo '<option value="text">text</option>';
    echo '<option value="blob">blob</option>';
    echo '<option value="mediumblob">mediumblob</option>';
    echo '<option value="mediumtext">mediumtext</option>';
    echo '<option value="longblob">longblob</option>';
    echo '<option value="longtext">longtext</option>';
    echo '<option value="enum">enum</option>';
    echo '<option value="set">set</option>';
    echo '</select></td>'; echo '<td><input type="text" name="field_length[]"></td>';

    echo '<td><select name="field_null[]">';
    echo '<option value="not null">不允许空值</option>';
    echo '<option value="null">允许空值</option>';
    echo '</select></td>';

    echo '<td><input type="text" name="field_default[]"></td>';

    echo '<td><select name="field_increse[]">';
    echo '<option value="">不自动增量</option>';
    echo '<option value="AUTO_INCREMENT">自动增量</option>';
    echo '</select></td>';
    echo '</tr>';
    }
    echo '</table>';
    echo '<input type="submit" value="确定">';
    }
    ?>
      

  3.   

    <?php
    //在MySQL中创建一个新数据库
    require 'main.inc';
    ?><?php
    $dbname = $arr_request['dbname'];
    $result = mysql_query("CREATE DATABASE $dbname");
    if (!$result)
    {
    show_title("创建数据库");
    show_dbs();
    show_msg("创建新数据库之前,请确认您拥有创建数据库的权限,并保证新数据库名称与已有数据库不重复。");
    echo '<form action='.$PHP_SELF.' method="post">';
    echo '<table>';
    echo '<tr>
    <td>数据库名称:</td><td><input type="text" name="dbname"></td>
         </tr>';
    echo '<tr>
    <td><input type="submit" value="确定"></td>
         </tr>';
    echo '</table>';
    echo '</form>';
    show_foot();
    }
    else
    {
    show_title("创建成功");
    show_msg("在MySQL创建数据库".$dbname."成功");
    show_dbs();
    show_foot();
    }
    ?>