Visualizzazione dei risultati da 1 a 3 su 3

Discussione: embed di video youtube

  1. #1
    Utente di HTML.it
    Registrato dal
    Mar 2013
    Messaggi
    20

    embed di video youtube

    ciao a tutti.
    allora devo creare su un sito un area dove è possibile caricare i video inserendo in un form il link preso da youtube, il quale verrà salvato sul database e poi dovrebbe dico dovrebbe essere visualizzato nella pagina video... però c'è un problema ovvero anche se a me sembra di aver fatto tutto in modo corretto il video non si vede. vi posto lo script
    Codice PHP:

    <?php

    require "paginazione/include/config.inc.php";
    require 
    "paginazione/include/dbms.inc.php";
    require 
    "paginazione/include/paginazione.inc.php";

    $webpage basename($_SERVER['PHP_SELF']);
    $page = (!isset($_GET['page']))? $_GET['page'];
    $result mysql_query("select * FROM  video ORDER BY id DESC");
    $max_results 5;//numero di elementi da visualizzare per pagina.
    $total_results mysql_num_rows($result);
    $total_pages ceil($total_results $max_results);
    $from = (($page $max_results) - $max_results);
    $result=mysql_query("select * FROM video ORDER BY id DESC LIMIT $from$max_results ");

    $linkvideo 'videourl';

    $linkvideocorretto=$linkvideo
    $linkvideocorretto=str_replace("watch?v=""v/"$linkvideocorretto); 


    // convertiamo in array utilizzando la & come separatore
    $array explode("?",$linkvideocorretto);
    $linkvideocorretto2=$array[0];


    while (
    $row mysql_fetch_array($result))
    {
        
        echo 
    "<table width='530px' cellspacing='6' id='tabella_richieste'>";
        
        echo 
    "<tr>";
        echo 
    "<td><table width='100%' id='tabella_td'>";
        echo 
    "<tr>";
        echo 
    "<td width='30%'>TITOLO:</td>";
        echo 
    "<td width='70%'>" $row['videotitolo'] . "</td>";
        echo 
    "</tr>";
        echo 
    "</table></td>";
        echo 
    "</tr>";
            
        echo 
    "<tr>";
        echo 
    "<td><table width='100%' id='tabella_td'>";
        echo 
    "<tr>";
        echo 
    "<td width='30%'>didascalia:</td>";
        echo 
    "<td width='70%'>" $row['videodidascalia'] . "</td>";
        echo 
    "</tr>";
        echo 
    "</table></td>";
        echo 
    "</tr>";
        
        echo 
    "<tr>";
        echo 
    "<td><table width='100%' id='tabella_td'>";
        echo 
    "<tr>";
        echo 
    "<td width='30%'>DESCRIZIONE</td>";
        echo 
    "<td width='70%'><object width=\"507\" height=\"248\"><param name=\"movie\"
    value=\"
    $linkvideocorretto2?hl=it_IT&fs=1&rel=0&color1=0x5d1719&color2=0xcd311b
    \"></param><param name=\"allowFullScreen\" value=\"true\"></param><param
    name=\"allowscriptaccess\" value=\"always\"></param><embed
    src=\"
    $linkvideocorretto2?hl=it_IT&fs=1&rel=0&color1=0x5d1719&color2=0xcd311b\"
    type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\"
    allowfullscreen=\"true\" width=\"507\" height=\"248\"></embed></object></td></td>"
    ;
        echo 
    "</tr>";
        echo 
    "</table></td>";
        echo 
    "</tr>";
        

        
        echo 
    "<tr>";
        echo 
    "<td id=\"link_cancella\"><a href = 'paginazione/cancellaEvento.php?id=" $row['id'] . "'>CANCELLA EVENTO</a></td>";
        echo 
    "</tr>";
        
        
        echo 
    "</table>";
        echo 
    "
    "
    ;
    }

    echo 
    pagination_3($total_pages$page$webpage);


    ?>
    sapete aiutarmi a scovare l'errore?

  2. #2
    Utente di HTML.it
    Registrato dal
    Mar 2013
    Messaggi
    20
    ok ci sono l'errore sta sicuramente qua
    Codice PHP:
    $linkvideo "videourl"
    sono davvero alle prime armi con php com'è che potrei sistemare lo script?

  3. #3
    Utente di HTML.it
    Registrato dal
    Mar 2013
    Messaggi
    20
    per ora ho risolto così se qualcuno lo sà fare meglio mi faccia sapere

    Codice PHP:
    <?php

    require "paginazione/include/config.inc.php";
    require 
    "paginazione/include/dbms.inc.php";
    require 
    "paginazione/include/paginazione.inc.php";

    $webpage basename($_SERVER['PHP_SELF']);
    $page = (!isset($_GET['page']))? $_GET['page'];
    $result mysql_query("select * FROM  video ORDER BY id DESC");
    $max_results 5;//numero di elementi da visualizzare per pagina.
    $total_results mysql_num_rows($result);
    $total_pages ceil($total_results $max_results);
    $from = (($page $max_results) - $max_results);
    $result=mysql_query("select * FROM video ORDER BY id DESC LIMIT $from$max_results ");

    // convertiamo in array utilizzando la & come separatore
    //$array = explode("?",$linkvideocorretto);
    //$linkvideocorretto2=$array[0];

    while ($row mysql_fetch_array($result))

    {
        
    $linkvideo $row['videourl'];
        
    $linkvideocorretto=$linkvideo
        
    $linkvideocorretto=str_replace("watch?v=""embed/"$linkvideocorretto);

            echo     
    "<table width=\"100%\" border=\"0\" cellspacing=\"6\" id='tabella_richieste'>";
            echo         
    "<tr>";
            echo       
    "<td><iframe width=\"200\" height=\"150\" src=\"$linkvideocorretto\" frameborder=\"0\" allowfullscreen></iframe></td>";
            echo        
    "<td><table width=\"100%\" height:\"100%\" border=\"0\" cellspacing=\"6\">";
            echo              
    "<tr>";
            echo            
    "<td  height:\"10%\" id='tabella_td'>"$row['videotitolo'] ."</td>";
            echo              
    "</tr>";
            echo              
    "<tr>";
            echo            
    "<td  height:\"80%\" id='tabella_td'>"$row['videodidascalia'] ."</td>";
            echo              
    "</tr>";
            echo            
    "<tr>";
            echo            
    "<td  height:\"10%\" id=\"link_cancella\"><a href = 'paginazione/cancellaEvento.php?id=" $row['id'] . "'>CANCELLA EVENTO</a></td>";
            echo              
    "</tr>";
            echo            
    "</table></td>";
            echo         
    "</tr>";
            echo        
    "</table>";
        
    }

    echo 
    pagination_3($total_pages$page$webpage);


    ?>

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.