查看文件: video_add.php
大小: 5.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")) { $write=''; $imgpath= '/www2/skybni/video_img/logo/'; $tfile1="fileToUpload1"; $vimg=date('ymdHis'); //250203170830 //lbg_ext001 2001 lbg_ext002 2002 $imagename=''; if($_FILES[$tfile1]["name"]<>''){ $ext1= explode('.',$_FILES[$tfile1]['name']) ; $imgext1=strtolower($ext1[count($ext1)-1]); //取最後一筆 $imgextarr=array('png','jpg','jpeg'); if( in_array($imgext1,$imgextarr)){ $imagename= $vimg.'.'.$imgext1; $pic1=$imgpath.$imagename; move_uploaded_file($_FILES[$tfile1]["tmp_name"],$pic1); } } $updateSQL = sprintf("INSERT INTO youvideo (ydoc,ykid,ylink,yflag,yimage,yindex)VALUES(%s,%s,%s,%s,%s,%s)", GetSQLValueString($_POST['ydoc'], "text"), GetSQLValueString($_POST['ykid'], "text"), GetSQLValueString($_POST['ylink'], "text"), GetSQLValueString($_POST['yflag'], "text"), GetSQLValueString($imagename, "text"), GetSQLValueString($_POST['yindex'], "int")); mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($updateSQL, $BE2) or die(mysql_error()); $updateGoTo =$_POST['url']; echo "<script>alert('上傳完成 ..');location.href='".$updateGoTo."';</script>"; //$_GET['id']=$_POST['lid']; } mysql_select_db($database_BE2, $BE2); $query_R2 = "SELECT * FROM video_master where 1 order by vkid,vdoc"; $R2 = mysql_query($query_R2, $BE2) or die(mysql_error()); $row_R2 = mysql_fetch_assoc($R2); ?> <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">廣告影片(區塊)-新增</h3> </div> <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"><span class="font2">分類影片 新增</span> </th> </tr> <tr valign="baseline"> <th height="42" align="center" valign="middle" nowrap="nowrap"><span class="font2">分類:</span></th> <td valign="middle"><select name="ykid" id="ykid"> <? do{ $vdoc=($row_R2['video']=='Y')?'-影片':'-圖檔'; ?> <option value="<?= $row_R2['vid'] ?>"><?= $row_R2['vkid'].'.'.$row_R2['vdoc'].$vdoc?></option> <? }while ($row_R2 = mysql_fetch_assoc($R2)); ?> </select></td> <td width="6%" valign="baseline"> </td> </tr> <tr valign="baseline"> <th height="42" align="center" valign="middle" nowrap="nowrap"><span class="font2">說明</span>:</th> <td valign="middle"><input name="ydoc" type="text" id="ydoc" value="" size="32" /></td> <td width="6%" valign="baseline"> </td> </tr> <tr valign="baseline"> <th width="16%" height="38" align="center" valign="middle" nowrap="nowrap"><span class="font2">連結</span>:</th> <td width="78%" valign="middle"><input name="ylink" type="text" id="ylink" value="" size="32" /></td> <td width="6%" valign="baseline"> </td> </tr> <tr valign="baseline"> <th height="42" align="center" valign="middle" nowrap="nowrap"><span class="font2">主圖:</span></th> <td valign="middle"><input name="fileToUpload1" type="file" id="fileToUpload1" /> 130 x 108px (非 youtube 影音 ) </td> <td valign="baseline"> </td> </tr> <tr valign="baseline"> <th height="42" align="center" valign="middle" nowrap="nowrap"><span class="font2">排序值:</span></th> <td valign="middle"><input name="yindex" type="text" id="yindex" value="100" size="32" /></td> <td valign="baseline"> </td> </tr> <tr valign="baseline"> <td height="30" align="center" valign="middle" nowrap="nowrap"><span class="font2">啟用:</span></td> <td height="30" align="left" valign="middle" nowrap="nowrap"><label for="select"></label> <select name="yflag" id="yflag"> <option value="Y" selected="selected" >Y</option> <option value="N">N</option> </select></td> <td align="left" valign="middle" nowrap="nowrap"> </td> </tr> <tr valign="baseline"> <td height="34" colspan="3" align="center" valign="middle" nowrap="nowrap">上傳圖檔僅限 png , jpg<br> 如是影片連結,連結如下例 : <font color="red"> https://www.youtube.com/watch?v=qN4PwY4jEsY</font></p></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="tbc" id="tbc" value="旅遊網" /> <input name="url" type="hidden" id="url" value="<?= $_SERVER['HTTP_REFERER']; ?>" /> </form> <div id="back"><a href="javascript:history.back();"><img src="images/back.gif" alt="回上一頁" title="回上一頁" width="115" height="32" border="0"></a></div> </div> </div> </div> <? mysql_free_result($R2); ?>
保存
取消
返回文件列表