|
|
|
ช่วยตอบวิธี limit ขนาด file กับ file type หน่อยคับ |
|
|
|
|
|
|
|
<?
require_once("../includes/API.php");
require_once("../includes/AppFunction.php");
require_once("../includes/clsDateTimeConv.php");
DBInit();
DBGetConn();
if (strcmp($Submit, "สมัคร") == 0) {
$dtmToday = new DateTimeObj(time());
$strSQL = "INSERT INTO tbl_Gallery_Player (intGalID, strFirstName, strLastName, strBday, strNschool, strAschool, strStel, strAddress, strTel, strShow, strKnow, strFname, strFAddress, strFtel, strMname, strMAddress, strMtel, strImage, dtmCreated) VALUES (" . $intGalID . ", '" . $strFirstName . "', '" . $strLastName . "', '" . $strBday . "', '" . $strNschool . "', '" . $strAschool . "', '" . $strStel . "', '" . $strAddress . "', '" . $strTel . "', '" . $strShow . "', '" . $strKnow . "', '" . $strFname . "', '" . $strFAddress . "', '" . $strFtel . "', '" . $strMname . "', '" . $strMAddress . "', '" . $strMtel . "', '" . $strImage . "', '" . $dtmToday->datetimeconv("-", $dtmToday->YMDSTD, 0) . "')";
//echo("strSQL: " . $strSQL . "<br>");
$conn->execute($strSQL);
$strSQL = "SELECT intPlayerID FROM tbl_Gallery_Player ORDER BY intPlayerID DESC LIMIT 0, 1";
$rs = $conn->Execute($strSQL);
if (!$rs==false) {
list($intPlayerID) = $rs->fields;
}
$rs->close();
if (!empty($strImage))
{
$strFilePath = strrchr($strImage_name,".");
$xxxx = "http://www.fyathai.com/images/gallery/W" . $intGalID . "-" . $intPlayerID . $strFilePath;
$strFilePath = "../images/gallery/W" . $intGalID . "-" . $intPlayerID . $strFilePath;
copy($strImage, $strFilePath);
$strSQL = "UPDATE tbl_Gallery_Player SET strImage = 'W" . $intGalID . "-" . $intPlayerID . strrchr($strImage_name,".") . "' WHERE intPlayerID = " . $intPlayerID;
$conn->execute($strSQL);
}
$strFirstName = trim(htmlspecialchars($strFirstName));
$strLastName = trim(htmlspecialchars($strLastName));
$intGalID = trim(htmlspecialchars($intGalID));
$strSQL = "SELECT strGalName FROM tbl_Gallery_Main WHERE intGalID = " . $intGalID;
$rs = $conn->Execute($strSQL);
if (!$rs===false) {
for(;!$rs->EOF;$rs->MoveNext()) {
list($strGalName) = $rs->fields;
}
}
$rs->close();
header("Location: report.php");
}
?>
Tag : - - - -
|
|
|
|
|
|
Date :
9 ธ.ค. 2547 22:05:50 |
By :
ziamzone |
View :
2833 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
พี่ส่ง source มาให้อะคับ อยากรู้ทำยังไงดี จะ limit file ให้ up ได้แต่ jpg gif แล้วก็ขนาดไม่เกิน 71680 byte
|
|
|
|
|
Date :
9 ธ.ค. 2547 22:07:08 |
By :
นักถาม |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ไฟล์ Type
if(($file_type=="image/jpg") || ($file_type=="image/jpeg") || ($file_type=="image/pjpeg"))
{
}
ไฟล์ Size
if($file_type >71680 )
{
// เกินพิกัด
}
|
|
|
|
|
Date :
11 ธ.ค. 2547 15:47:24 |
By :
@W_IN |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|