[+] EDITØR MODE [+]
htdocs
>
web
>
gallery_video.php
Edit File: gallery_video.php
<?php define('DB_SERVER', 'hostingmysql323.register.it'); define('DB_USERNAME', 'gregorio'); define('DB_PASSWORD', 'fontana2015'); define('DB_DATABASE', 'fontanaarchitetti'); $db = mysqli_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_DATABASE); session_start(); $user_check=$_SESSION['login_user']; $ses_sql=mysqli_query($db,"select username from members where username='$user_check' "); $row=mysqli_fetch_array($ses_sql,MYSQLI_ASSOC); $login_session=$row['username']; if(!isset($login_session)) { header("Location: admin.php"); } ?> <?php include_once 'common.php'; $servername = "hostingmysql323.register.it"; $username = "gregorio"; $password = "fontana2015"; $dbname = "fontanaarchitetti"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } ?> <html> <head> <!-- ------------------------------------------------META------------------------------------------------ --> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="cache-control" content="max-age=0"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT"> <meta http-equiv="pragma" content="no-cache"> <meta charset="UTF-8"> <title>Fontana Architetti - Amministrazione</title> <link rel="stylesheet" href="css/style.css" media="screen" type="text/css" /> <script src="./ckeditor/ckeditor.js"></script> </head> <body> <?php echo '<a href="admin_index.php"><div id="header"> <h1> Fontana Architetti - Amministrazione</h1></div></a> <div id="sottoheader"> <div class="back"><a href="admin_index.php"><img src="img/admin/back.jpg"></a></div> <div class="tit"><h1>Inserisci video</h1></div> </div> '; if($_GET["load"] === "yes") echo '<div id="load"><h1>Caricamento avvenuto con successo</h1></div>'; if($_GET["load"] === "no") echo '<div id="errorl"><h1>ERRORE!</h1></div>'; /*if (empty($_GET["load"])) { echo '<div id="info"><h1>ATTENZIONE: tutti i campi sono obbligatori!</h1></div>'; };*/ ?> <div id="blocco"> <p class="istruzioni">Per inserire un video è necessario inserire nel campo <em>stringa video</em> il codice che youtube riporta nella barra degli indirizzi dopo "watch?v=". Per esempio per il video "https://www.youtube.com/watch?v=hT_nvWreIhg" è necessario inserire "hT_nvWreIhg". <br/> <b> N.B. è possibile inserire solamente video caricati su youtube.</b> <br/> <b> N.B. I video vengono già caricati nella categoria specifica (ovvero non è necessario definire nella pagina di ordinamento se è un disegno o un'immagine), ma è sempre necessario indicare la posizione 1 anche se si è caricato un solo video.</b></p> <br style="clear:both" /> <?php $tabella = $_GET['subf']; $elemento = $_GET['id_gal']; $sql = 'SELECT * FROM '.$_GET['subf'].' WHERE id = "'.$_GET['id_gal'].'"'; $result = $conn->query($sql); $currentDate = false; if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { if ($tabella == "prog" or $tabella == "conc" or $tabella == "episodi"){ echo '<p> Carica video in <b>'.strip_tags($row['titolo_IT'], "<b><strong><i><em>").'</b></p><br/>'; } else { echo '<p> Carica video in <b>'.strip_tags($row['titolo'], "<b><strong><i><em>").'</b></p><br/>'; }; } }; ?> <div id="formz_l"> <form name="vid_form" action="PHP_script/loader_vid.php" method="post"> <?php echo '<input type="hidden" name="subf" id="subf" value="'.$_GET['subf'].'">'; echo '<input type="hidden" name="id_gal" id="id_gal" value="'.$_GET['id_gal'].'">'; ?> <div class="insert"> <label for="path">Stringa video</label> <input type="text" name="path" id="path" autocomplete="off"> </div> <input type="submit" id="register" name="register" value="Inserisci video"> </form> </div> <script> CKEDITOR.replace( "titolo" ); </script> <script> CKEDITOR.replace( "testo" ); </script> </div> </body> </html>
Method:
fopen()
file_put_contents()
stream_context_create()
Simpan
Rename:
Rename