查看文件: line_add.php
大小: 3.24 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")) { $logo_img='/www2/skybni/images/line/'.$lcode; $tfile1="fileToUpload1"; $upfile=''; if($_FILES[$tfile1]["name"]<>''){ $lcode='logo'.date('YmdHis'); $logo_img='/www2/skybni/images/line/'.$lcode; $ext1= explode('.',$_FILES[$tfile1]['name']) ; $imgext1=strtolower($ext1[count($ext1)-1]); //取最後一筆 $imgextarr=array('png','jpg','jpeg','gif'); if( in_array($imgext1,$imgextarr)){ $upfile=$lcode.'.'.$imgext1; $pic1=$logo_img.".".$imgext1; move_uploaded_file($_FILES[$tfile1]["tmp_name"],$pic1); } } $insertSQL = sprintf("INSERT INTO line_img (lurlbase, lurl, limg, ldoc) VALUES (%s, %s, %s, %s )", GetSQLValueString($_POST['lurlbase'], "text"), GetSQLValueString($_POST['lurl'], "text"), GetSQLValueString($upfile, "text"), GetSQLValueString($_POST['ldoc'], "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" /> </td> <td width="35%" rowspan="2" valign="baseline"><img src="/images/line/skybni.jpg" width="180" alt="logo" /></td> </tr> <tr valign="baseline"> <th width="16%" height="38" align="right" valign="top" nowrap="nowrap">頁面說明:</th> <td width="49%" valign="baseline"><textarea name="ldoc" cols="32" rows="4" id="doc1">雲端異業互聯網&實景街圖導覽,街角網路商店,購物,廣告系統。</textarea></td> </tr> <tr valign="baseline"> <td height="34" colspan="3" align="center" valign="middle" nowrap="nowrap">PS: 僅限上傳<font color="red"> PNG,JPG </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>
保存
取消
返回文件列表