|
 |
|
พี่ๆช่วยหน่อยค่ะ ไม่รุเป็นไร Add ข้อมูลไม่ได้นะค่ะ แต่ในเครื่องทำได้นะค่ะ พอขึ้น host แล้วใช่ไม่ได้นะค่ะ |
|
 |
|
|
 |
 |
|
พี่ๆช่วยหน่อยค่ะ ไม่รุเป็นไร Add ข้อมูลไม่ได้นะค่ะ แต่ในเครื่องทำได้นะค่ะ พอขึ้น host แล้วใช่ไม่ได้นะค่ะ ช่วยหน่อยนะค่ะ รบกวนด้วยค่ะ ขอบคุณพี่ๆ ทุกคนล่วงหน้าค่ะ
Code (PHP)
<?php
#### สคริ๊ปนี้ใช้ในการเช็ค ว่าล็อกอินหรือยัง ให้นำสคริ๊ปนี้ไปไว้ที่หน้าที่คุณต้องการให้เช็ค ####
session_start() ;
if(!session_is_registered("login_true")) {
// url=index.php คำสั่งนี้จะให้ไปหน้าที่จะต้องกรอก user,pwd ถ้าอยู่โฟล์เดอร์อื่นให้เรียกให้ถูกนะครับ
echo "<meta http-equiv='refresh' content='0;url=index.php'>" ;
exit() ;
}
### จบการเช็ค ###
?>
<?
include("../include/function.php");
con();
if ($HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST")
{
########### image ############
$main_dir="../images/";
$sub_dir="product/";
############################
$pic_1=upload_images($_FILES['pic_1'],$main_dir,$sub_dir);
$name=$_POST[name];
$sql = "select * from product_cat order by id desc" ;
$result = mysql_query($sql) ;
$num_result = mysql_num_rows($result) ;
$dbarr = mysql_fetch_row($result) ;
mysql_query("INSERT INTO `product_cat` (name , pic1 , active , added) VALUES ('".$name."' ,'".$pic_1."', 'yes' , NOW( ) )") or die("ERROR : INSERT INTO `product_cat` (name , pic1 , active , added) VALUES ('".$name."' ,'".$pic_1."', 'yes' , NOW( ) )");
echo "<meta http-equiv='refresh' content='0; url=product.php'>" ;
}
include("header.php");
?>
<style type="text/css">
<!--
.style1 {font-family: "MS Sans Serif"}
.style2 {
color: #0000FF;
font-size: 14px;
}
.style3 {color: #000000}
.style5 {
color: #000000;
font-size: 14px;
font-family: "Microsoft Sans Serif";
}
.style7 {
font-family: "MS Sans Serif";
font-size: 14px;
color: #000000;
}
a:link {
color: #0000FF;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #0000FF;
}
a:hover {
text-decoration: none;
color: #0000FF;
}
a:active {
text-decoration: none;
color: #0000FF;
}
-->
</style>
<table width="883" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="754" align="left" valign="bottom"><table width="754" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="middle" class="ape-b14 style2"><strong><span class="style1"><a href="product.php" class="ape-b14">Product </a></span></strong><span class="ape-12 style1"><strong>> </strong></span><span class="style1"><strong class="ape-12">Add Product</strong></span></td>
</tr>
</table></td>
<td width="129" align="right" valign="middle"><A HREF="logout.php"><img src="images/btu_logout.gif" width="78" height="30" border=0 /></A></td>
</tr>
</table></td>
<td background="images/bg_top_main.gif"> </td>
</tr>
<tr>
<td height="1" bgcolor="#e0e0e0"><img src="images/space.gif" width="1" height="1" /></td>
<td height="1" align="left" valign="top" bgcolor="#e0e0e0"><img src="images/space.gif" alt="" width="1" height="1" /></td>
<td height="1" bgcolor="#e0e0e0"><img src="images/space.gif" alt="" width="1" height="1" /></td>
</tr>
<tr>
<td height="243" background="images/bg_top_main.gif"> </td>
<td height="243" align="left" valign="top" background="images/bg_top_main.gif">
<FORM METHOD=POST ACTION="" name="form" encType="multipart/form-data">
<table width="883" border="0" align="center" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="883" height="32" valign="top"><img src="images/space.gif" width="1" height="32" /></td>
</tr>
<tr>
<td height="81" align="left" valign="top">
<table width="883" border="0" cellspacing="0" cellpadding="0">
<!--DWLayoutTable-->
<tr>
<td width="103" height="36" align="right" valign="middle" class="ape-12"><div align="left" class="style5"><strong>Logo</strong></div></td>
<td width="32"> </td>
<td width="748" align="left" valign="middle"><input type="file" name="pic_1" id="pic_1" style="width:340px;height:25;" /></td>
</tr>
<tr>
<td height="36" align="right" valign="middle"><div align="left" class="style5"><strong>Name</strong></div></td>
<td> </td>
<td valign="top"><span class="txt_content">
<input name="name" type="text" class="box" id="name" value="" style="width:340px;height:25px;" />
</span></td>
</tr>
<tr>
<td height="9"></td>
<td></td>
<td></td>
</tr>
</table></td>
</tr>
<tr>
<td height="38"> </td>
</tr>
<tr>
<td height="68" valign="top">
<table width="883" border="0" cellspacing="0" cellpadding="0">
<!--DWLayoutTable-->
<tr>
<td width="76" height="32"> </td>
<td width="125" align="left" valign="middle"><a href="#" onclick="javascript:document.form.submit()"><img src="images/btu_submit.png" width="89" height="32" border="0" /></a></td>
<td width="682" align="left" valign="middle"><A HREF="create_product.php" ><img src="images/btu_reset.png" width="77" height="32" border="0" /></a></td>
</tr>
<tr>
<td height="32"></td>
<td></td>
<td></td>
</tr>
</table></td>
</tr>
</table>
</FORM>
</td>
</tr>
<? include("footer.php"); ?>
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-11-04 13:24:30 |
By :
sangkheb |
View :
801 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
|
|

|
Load balance : Server 04
|