HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/xampp/htdocs/ACProof/admin/add.php
<?php
/*
All source code copyright and proprietary Melonfire, 2002. All content, brand names and trademarks copyright and proprietary Melonfire, 2002. All rights reserved. Copyright infringement is a violation of law.

This source code is provided with NO WARRANTY WHATSOEVER. It is produced and meant for illustrative purposes only, and is NOT recommended for use in production environments. 

Read more articles like this one at http://www.melonfire.com/community/columns/trog/ and http://www.melonfire.com/
*/

// add.php - add a new press release
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<basefont face="Verdana">
</head>

<body>

<!-- standard page header begins -->
<p>&nbsp;<p>

<table width="100%" cellspacing="0" cellpadding="5">
<tr>
	<td></td>
</tr>
<tr>
	<td bgcolor="Navy"><font size="-1" color="White"><b>基本資料作業: Add</b></font></td>
</tr>
</table>
<!-- standard page header ends -->

<p>

<?php
// form not yet submitted
// display initial form
if (!isset($submit))
{
?>
<table cellspacing="5" cellpadding="5">
<form action="<?php echo $PHP_SELF; ?>" method="POST">
 <tr>
      <td colspan="2" scope="row"><font size="-1">類別: </font>
        <select name="type">
          <option value="pr" >繪圖機 </option>
          <option value="pa" >紙張 </option>
        </select></td>
      <td>&nbsp;</td>
    </tr>
<tr>
	<td valign="top"><font size="-1">型號:</font></td>
	<td><input size="50" maxlength="250" type="text" name="ddes" ></td>
</tr>


<tr>
	<td colspan=2><input type="Submit" name="submit" value="Add"></td>
</tr>
</form>
</table>
<?php
}
else
{


		// open database connection
$host="127.0.0.1";
$user="root";
$pass="fredsql";
$db="fograproof";
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
mysql_query("SET NAMES 'utf8'");
//$link = mssql_connect("MACBOOK7", "sa", "fred5697");
mysql_select_db($db) or die ("Unable to select database!");

		$query = "INSERT INTO ACdevice(type, ddes) VALUES('$type', '$ddes')";
		$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
  
		mysql_close($connection);
	
	?>
	<tr>
  <td width="282" colspan="2"><a href="./list.php">基本資料作業</a></td>
  <br>
  <br>
</tr>
	<tr>
  <td width="282" colspan="2"><a href="../acindex.php">Home</a></td>
</tr>
<?php

}
?>

<!-- standard page footer begins -->
<p>
<table width="100%" cellspacing="0" cellpadding="5">

</table>
<!-- standard page footer ends -->


</body>
</html>