查看文件: logo_add.php
大小: 5.27 KB
类型: application/octet-stream
<?php require('system/login.php'); ?> <?php require_once('../Connections/BE2.php'); ?> <?php if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $lcode='logo'.date('YmdHis'); $logo_img='/www2/skybni/logo_img/'.$lcode; $tfile1="fileToUpload1"; if($_FILES[$tfile1]["name"]<>''){ $ext1= explode('.',$_FILES[$tfile1]['name']) ; $imgext1=strtolower($ext1[count($ext1)-1]); //取最後一筆 if($imgext1=='png'){ $pic1=$logo_img."_1.".$imgext1; move_uploaded_file($_FILES[$tfile1]["tmp_name"],$pic1); } } $tfile2="fileToUpload2"; if($_FILES[$tfile2]["name"]<>''){ $ext2= explode('.',$_FILES[$tfile2]['name']) ; $imgext2=strtolower($ext2[count($ext2)-1]); //取最後一筆 if($imgext2=='png'){ $pic2=$logo_img."_2.".$imgext2; move_uploaded_file($_FILES[$tfile2]["tmp_name"],$pic2); } } $tfile3="fileToUpload3"; if($_FILES[$tfile3]["name"]<>''){ $ext3= explode('.',$_FILES[$tfile3]['name']) ; $imgext3=strtolower($ext3[count($ext3)-1]); //取最後一筆 if($imgext3=='png'){ $pic3=$logo_img."_3.".$imgext3; move_uploaded_file($_FILES[$tfile3]["tmp_name"],$pic3); } } $insertSQL = sprintf("INSERT INTO `logo_img` (lurlbase, lurl, lcode, doc1, doc2, doc3) VALUES (%s, %s, %s, %s, %s, %s )", GetSQLValueString($_POST['lurlbase'], "text"), GetSQLValueString($_POST['lurl'], "text"), GetSQLValueString($lcode, "text"), GetSQLValueString($_POST['doc1'], "text"), GetSQLValueString($_POST['doc2'], "text"), GetSQLValueString($_POST['doc3'], "text")); mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($insertSQL, $BE2) or die(mysql_error()); $insertGoTo =$_POST['url'];// "main.php?act=user";"main.php?act=user"; // header(sprintf("Location: %s", $insertGoTo)); echo "<script>location.href='".$insertGoTo."';</script>"; } ?> <form action="" method="post" name="form1" id="form1" enctype="multipart/form-data"> <table width="52%" align="center"> <tr valign="baseline"> <th height="38" align="center" valign="middle" nowrap="nowrap">URL 目錄:</th> <td valign="middle"><input name="lurlbase" type="text" id="lurlbase" value="/" size="32" /></td> <td align="center" valign="middle">PS root: /</td> </tr> <tr valign="baseline"> <th height="22" align="center" valign="middle" nowrap="nowrap">URL 名稱:</th> <td valign="middle"><input name="lurl" type="text" id="lurl" value="" size="32" /></td> <td align="center" valign="middle"> PS: index</td> </tr> <tr valign="baseline"> <th height="38" align="right" valign="middle" nowrap="nowrap">主圖區塊:</th> <td valign="middle"><input name="fileToUpload1" type="file" id="fileToUpload1" /> 65 x 65pix</td> <td valign="baseline"><img src="../logo_img/skybni_logo.png" width="65" height="65" alt="logo" /></td> </tr> <tr valign="baseline"> <th width="16%" height="38" align="right" valign="top" nowrap="nowrap">Title doc1:</th> <td width="49%" valign="baseline"><input name="doc1" type="text" id="doc1" value="天空商城-SKYBNI" size="32" /></td> <td width="35%" valign="baseline"> </td> </tr> <tr valign="baseline"> <th height="30" align="right" valign="top" nowrap="nowrap">上方圖檔:</th> <td valign="baseline"><input name="fileToUpload2" type="file" id="fileToUpload2" /> 125 x 24 pix</td> <td valign="baseline"><img src="../logo_img/b1.png" width="125" height="24" alt="logo" /><br></td> </tr> <tr valign="baseline"> <td height="30" align="center" valign="middle" nowrap="nowrap">Title doc2:</td> <td height="30" align="left" valign="middle" nowrap="nowrap"><input name="doc2" type="text" id="doc2" value="天空商城-SKYBNI" size="32" /></td> <td align="left" valign="middle" nowrap="nowrap"> </td> </tr> <tr valign="baseline"> <td height="30" align="center" valign="middle" nowrap="nowrap">下方圖檔:</td> <td height="30" align="left" valign="middle" nowrap="nowrap"><input name="fileToUpload3" type="file" id="fileToUpload3" /> 125 x 24 pix</td> <td align="left" valign="middle" nowrap="nowrap"><img src="../logo_img/skybni.png" width="125" height="24" alt="logo" /></td> </tr> <tr valign="baseline"> <td height="30" align="center" valign="middle" nowrap="nowrap">Title doc3:</td> <td height="30" align="left" valign="middle" nowrap="nowrap"><input name="doc3" type="text" id="doc3" value="天空商城-SKYBNI" size="32" /></td> <td align="left" valign="middle" nowrap="nowrap"> </td> </tr> <tr valign="baseline"> <td height="34" colspan="3" align="center" valign="middle" nowrap="nowrap">PS: 僅限上傳<font color="red"> PNG</font> 檔</td> </tr> <tr valign="baseline"> <td height="40" colspan="3" align="center" valign="middle" nowrap="nowrap"><input type="submit" value="新增" /></td> </tr> </table> <input type="hidden" name="MM_insert" id="MM_insert" value="form1" /> <input name="url" type="hidden" id="url" value="<?= $_SERVER['HTTP_REFERER']; ?>" /> </form>
保存
取消
返回文件列表