Video galleria in php no prende l'id

Jakub Lemiszewski

Utente Attivo
5 Dic 2013
119
1
0
Salve,
Ho creato un semplice script php per avere una tabella con i video dal mio db.
Pero non funziona e i problemi sono:
1) Quando premo sul link del file dovrebbe mostrarmi nello url l'id del file che ho richiesto. L'id arriva dal db.
2) Quando premo sul link dovrebbe mandarmi su una altra pagina dove vedo il video invece mi fa il download o non mi mostra nulla. Mi potreste aiutare a correggere gli errori grazie.

Ecco il codice:

PHP:
<?php
/**
 * Created by PhpStorm.
 * User: jakublemiszewski
 * Date: 24/10/14
 * Time: 15:52
 */
require_once 'dbConnection.php';
?>

<html>
<head>
    <title></title>
</head>
<body>
<h2><font color="#54164e"><center>Video Gallery</font></center></h2>
<table align="center" bgcolor="#9a7608" cellpadding="10" cellspacing="3">
    <tr bgcolor="#ffffff">
        <th> <center> ID </center>
        <th> <center>Name Of Video</center> </th>
    </tr>

<?php

$query = "SELECT * FROM video";
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result)){
    $id         = $row['id'];
    $filename   = $row['filename'];
    $htmlBody  = '<tr bgcolor="#ffffff">';
    $htmlBody .= '<td> '."$id".'</td>';
    $htmlBody .= '<th><a href="showVideo.php?id=$id">'."$filename".'</a></th>';

    echo $htmlBody;
}
        ?>

</table>
</form>
</body>
</html>
 

Night Assassin

Utente Attivo
16 Mar 2013
200
0
0
PHP:
<?php
/**
 * Created by PhpStorm.
 * User: jakublemiszewski
 * Date: 24/10/14
 * Time: 15:52
 */
require_once 'dbConnection.php';
?>

<html>
<head>
    <title></title>
</head>
<body>
<h2><font color="#54164e"><center>Video Gallery</font></center></h2>
<table align="center" bgcolor="#9a7608" cellpadding="10" cellspacing="3">
    <tr bgcolor="#ffffff">
        <th> <center> ID </center>
        <th> <center>Name Of Video</center> </th>
    </tr>

<?php

$query = "SELECT * FROM video";
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result)){
    $id         = $row['id'];
    $filename   = $row['filename'];
    $htmlBody  = '<tr bgcolor="#ffffff">';
    $htmlBody .= '<td> '."$id".'</td>';
    $htmlBody .= '<th><a href="showVideo.php?id='."$id".'">'."$filename".'</a></th>';

    echo $htmlBody;
}
        ?>

</table>
</form>
</body>
</html>



Inviato con Tapatalk 2 da Android
 
Discussioni simili
Autore Titolo Forum Risposte Data
J Galleria di video PHP 1
N php problemi a visualizzare video PHP 3
L Montoggio video Offerte e Richieste di Lavoro e/o Collaborazione 0
Max 1 Software elaborazione video Windows e Software 1
D Stampa a video solo campi compilati MySQL 1
D Carousel bootstrap con video HTML e CSS 2
Daniele_Carrara Consigli scheda video - Blender Webdesign e Grafica 2
D Inserimento video mp4 HTML e CSS 0
G leggere file txt e stampare con php il contenuto a video PHP 7
F stampare a video i risultati della query PHP 1
M Visualizzazione a video risultati query php PHP 0
R inserire video nel sito HTML e CSS 15
D Stampa a video in altra pagina html Database 3
felino Importare VHS: video in bianco e nero Discussioni Varie 6
Z Video protetto con PHP PHP 0
P Mascheramento video youtube su sito proprio HTML e CSS 5
Beppe2 Visualizzazione sottotitoli video HTML e CSS 2
M [VENDO] Banner / Video Vendere e Acquistare pubblicita' online 1
elpirata Query per leggere dati da una tabella mysql e mostrarli a video in base a parametri passati tramite GET PHP 5
L Come spostare cartella immagini/video PHP 1
L [RISOLTO] Stampa a video risultato count in html PHP 13
J estrarre url dei file video da youtube "get_video_info" PHP 6
F [PHP] Slideshow video PHP 0
F [PHP] Visualizzazione video PHP 3
S Problemi con modulo upload video php (help!) PHP 0
T Come ruotare un video in maniera veloce? Discussioni Varie 2
S [PHP] Stampa a video Nome e Cognome in seguito a login PHP 1
C [Vendo] Sito web video animali e divertenti Compravendita siti e domini 0
A sommare valori a video per lo stesso giorno jQuery 1
trattorino estrarre titolo video facebook in php PHP 0
M problema con video in html 5 HTML e CSS 7
K [CERCO -RETRIBUITO] Realizzazione logo , banner, video copertina pagina FB Offerte e Richieste di Lavoro e/o Collaborazione 0
T [HTML] video in apertura sito. su pc ok, su smartphone KO HTML e CSS 0
F [PHP + MYSQLI] Stampa a video di una tabella nel database PHP 4
F Ipcam cinesi senza pagina web, come prelevo il flusso video, audio e tilt? IP Cam e Videosorveglianza 0
fida convertire i video in mp3 Discussioni Varie 2
M Esiste un sistema di video sorveglianza simile? IP Cam e Videosorveglianza 1
felino Software per video editing Windows e Software 14
W Followers, visualizzazioni video e storie + like instagram (rapidi) Annunci servizi di Social Media Marketing 1
P [PHP] Riconoscere video PHP 4
F Realizzare video su Mac Mac e Software 0
L [Photoshop] Aggiungere file video in timeline Photoshop 1
O [Javascript] overlay video Javascript 14
F FLUSSO VIDEO IP CAM IP Cam e Videosorveglianza 1
B [Photoshop] Scheda video esterna Photoshop 2
D Cerco pagina FB tema Cibo o travel o video Annunci servizi di Social Media Marketing 2
momeraths [HTML] Come non far scaricare video HTML e CSS 1
G [PHP] RICHIAMARE TABELLA I CUI VALORI SONO STAMPATI A VIDEO E MODIFICARLI PHP 6
R Traduzione del parlato in un video Youtube Social Media Marketing 1
M [Compro] video post su pagine facebook Vendere e Acquistare pubblicita' online 1

Discussioni simili