查看文件: logo_edit.php
大小: 6.3 KB
类型: application/octet-stream
<?php require('system/login.php'); ?> <?php require_once('../Connections/BE2.php'); ?> <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $lcode=$_POST['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); } } $updateSQL = sprintf("UPDATE logo_img SET lurl=%s,lurlbase=%s, doc1=%s, doc2=%s, doc3=%s where lid=%s", GetSQLValueString($_POST['lurl'], "text"), GetSQLValueString($_POST['lurlbase'], "text"), GetSQLValueString($_POST['doc1'], "text"), GetSQLValueString($_POST['doc2'], "text"), GetSQLValueString($_POST['doc3'], "text"), GetSQLValueString($_POST['lid'], "int")); mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($updateSQL, $BE2) or die(mysql_error()); $updateGoTo =$_POST['url'];// "main.php?act=user";"main.php?act=user"; // header(sprintf("Location: %s", $insertGoTo)); echo "<script>location.href='".$updateGoTo."';</script>"; //$_GET['id']=$_POST['lid']; } //echo $updateSQL; $colname_Rt2 = "-1"; if (isset($_GET['id'])) { $colname_Rt2 = (get_magic_quotes_gpc()) ? $_GET['id'] : addslashes($_GET['id']); } mysql_select_db($database_BE2, $BE2); $query_R1 = sprintf("SELECT * FROM logo_img WHERE lid = %s", $colname_Rt2); $R1 = mysql_query($query_R1, $BE2) or die(mysql_error()); $row_R1 = mysql_fetch_assoc($R1); $totalRows_R1 = mysql_num_rows($R1); ?> <form action="" method="post" name="form1" id="form1" enctype="multipart/form-data"> <table width="50%" align="center"> <tr valign="baseline"> <th height="38" colspan="3" align="center" valign="middle" nowrap="nowrap"> <? $iurl="https://skybni.com".$row_R1['lurlbase']; ?> <a href="<?= $iurl ?>" target="_blank"> <?= $iurl ;?></a></th> </tr> <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="<?= $row_R1['lurlbase']; ?>" size="32" /></td> <td align="center" valign="middle">PS root: /</td> </tr> <tr valign="baseline"> <th height="38" align="center" valign="middle" nowrap="nowrap">URL 名稱:</th> <td valign="middle"><input name="lurl" type="text" id="lurl" value="<?= $row_R1['lurl']; ?>" 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/<?= $row_R1['lcode']; ?>_1.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="<?= $row_R1['doc1']; ?>" 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/<?= $row_R1['lcode']; ?>_2.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="<?= $row_R1['doc2']; ?>" 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/<?= $row_R1['lcode']; ?>_3.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="<?= $row_R1['doc3']; ?>" 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_update" id="MM_update" value="form1" /> <input type="hidden" name="lid" id="lid" value="<?= $row_R1['lid']; ?>" /> <input type="hidden" name="lcode" id="lcode" value="<?= $row_R1['lcode']; ?>" /> <input name="url" type="hidden" id="url" value="<?= $_SERVER['HTTP_REFERER']; ?>" /> </form> <?php mysql_free_result($R1); ?>
保存
取消
返回文件列表