new_sub_form.php

来自「The Shift Log is a database entry and di」· PHP 代码 · 共 37 行

PHP
37
字号
<?PHP
			// Menu For the Category Select
			$conn;
			$select_db;
			$cat_sql="SELECT cat_id, catname FROM category ORDER BY cat_id"; 
			$cat_result=mysql_query($cat_sql); 
			$cat_options="";
			$cat_num_options=""; //for possible future use
			while ($row=mysql_fetch_array($cat_result)) 
				{ 
				$id=$row["cat_id"];
				$cat=$row["catname"]; 
    			$cat_options.="<OPTION VALUE=\"$cat\">".$cat; 
				$cat_num_options.="<OPTION VALUE=\"$id\">".$cat;  //for possible future use
				}
		?>
		<br />
	<!-- New Subcategory Form -->
	<form name="add_sub" action="<?php echo $HTTP_SERVER_VARS['PHP_SELF']; ?>" method="post">
	<table bgcolor="#CCCCCC" width="35%"  border="1">
  		<tr>
  			<td colspan="2" align="center"><strong>Add New Subcategory</strong></td>
    	</tr>
  		<tr>
    		<td width="45%">Select Category:</td>
    		<td width="55%" align="center"><select name="catid"><option value="0">Select One<?PHP echo $cat_num_options;?></select></td>
  		</tr>
  		<tr>
    		<td>New Submenu Name: </td>
    		<td align="center"><input type="text" name="mod_subname"></td>
  		</tr>
  		<tr>
    		<td align="center"><input type="reset"></td>
    		<td><input type="submit" name="new_sub" value="Submit" /></td>
  		</tr>
	</table>
	</form>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?