[PHP-users 2726] Re: HTML 中のPHP が実行されない

akira.i php-users@php.gr.jp
Mon, 15 Oct 2001 18:39:59 +0900


あきらです。
該当部分の抜粋ソースを送信します。

-----はじめ-----
<html>
<head>
    <title>商品メンテナンス画面</title>
    <meta http-equiv="Content-type" content="text/html; charset=x-euc-jp">
</head>
<body>
    <h3>商品登録</h3>
    <form action="test.php" method="post" enctype="multipart/form-data">
    <table border="0">
        <tr>
            <td align="right">
                商品カテゴリー:
            </td>
            <td>
                <?php
                    $conn = mysql_connect("localhost", "hoge", "");
                    if(!$conn)
                    {
                        exit;
                    }
                    if(!mysql_select_db("fuga"))
                    {
                        echo "Cannot Select DB";
                   $result = mysql_query("select * from item_master;");
                    if(!$result)
                    {
                        exit;
                    }
                    echo "<select name=\"item_cat\">\n";
                    while($row = @mysql_fetch_object($result))
                    {
                        echo "<option value=\" $row->item_no \">
$row->item_name
 </option>\n";
                    }
                    echo "</select>\n";
                ?>
            </td>
-----おわり-----