Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1602 connectés 

  FORUM HardWare.fr
  Programmation
  PHP

  [Resolu] Problème sur realbox

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[Resolu] Problème sur realbox

n°1629965
colorz
Posté le 24-10-2007 à 11:35:07  profilanswer
 

Bonjour,
J'ai un problème sur ce script qui n'es pas de moi pour afficher des videos avec realplayer.
J'essaye de le faire fonctionner en local avec easyphp mais ça passe pas. Néamoins il fonctionne bien sur les sites de free.
 
Le code :
 

Code :
  1. <?
  2. ///////////////////////////////////////////////
  3. //           REALBOX v1.0                    //
  4. //     Diffusion de fichiers                 //
  5. //          REAL MEDIA                       //
  6. ///////////////////////////////////////////////
  7. // http://vpontier.free.fr/                  //
  8. //      vpontier@free.fr                     //
  9. ///////////////////////////////////////////////
  10. //             PHP3                          //
  11. ///////////////////////////////////////////////
  12. // Il vous suffit de mettre vos              //
  13. // fichiers encodés en .rm dans              //
  14. // le sous-dossier rm et le tour             //
  15. // est joué....c'est tout !!                 //
  16. ///////////////////////////////////////////////
  17. //                                           //
  18. //      Démo sur El Roubio                   //
  19. //   http://vpontier.free.fr/?p=elroubio-tv  //
  20. //                                           //
  21. ///////////////////////////////////////////////
  22. /**********************************************
  23.            VARIABLES
  24. **********************************************/
  25. $domaine ="http://127.0.0.1/realbox/";
  26. $chem_ram = "ram/";
  27. $chem_rm = "ram/rm/";
  28. $chem_tv = "realbox.php3?";
  29. $var_tv = "ontv=";
  30. $video_x = "242";
  31. $video_y = "187";
  32. /*********************************************/
  33. ///////////////////////////////////////////////////////
  34. // Détecte les fichiers RealMédias dans le rep rm   ///
  35. ///////////////////////////////////////////////////////
  36. $myDirectory = opendir($chem_rm);
  37. while($entryName = readdir($myDirectory))
  38. {
  39.     if ($entryName !="." && $entryName !=".." )
  40. {
  41.     $ma_liste .= "$entryName"."|" ;
  42.     }
  43. }
  44. closedir($myDirectory);
  45. $ma_liste = substr($ma_liste,0,(strlen($ma_liste)-1));
  46. $entree = explode("|", $ma_liste);
  47. ///////////////////////////////////////////////////////
  48. // Plasse les .rm plus récents en premier           ///
  49. ///////////////////////////////////////////////////////
  50. function inverser( &$tableau ) {
  51. for($i = 0; $i < sizeof($tableau); $i++)
  52. $nTab[$i] = $tableau[ sizeof($tableau) - $i - 1];
  53. return $nTab; }
  54. $entree = inverser($entree);
  55. ///////////////////////////////////////////////////////
  56. ?>
  57. <script language="JavaScript">
  58. function MM_jumpMenu(targ,selObj,restore){
  59.   eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'" );
  60.   if (restore) selObj.selectedIndex=0;
  61. }
  62. </script>
  63. <body bgcolor="#660066">
  64. <center>
  65.   <h1><font color="#FF9933" face="Verdana, Arial, Helvetica, sans-serif">RealBox
  66.     v1.0</font></h1>
  67. </center>
  68. <TABLE WIDTH=474 BORDER=0 CELLPADDING=0 CELLSPACING=0 align="center">
  69. <TR>
  70. <TD WIDTH=474 HEIGHT=49 COLSPAN=4>
  71. <IMG SRC="ram/images/roubiotv.jpg" WIDTH=474 HEIGHT=49></TD>
  72. <TD WIDTH=1 HEIGHT=49>
  73. <IMG SRC="ram/images/espaceur.gif" WIDTH=1 HEIGHT=49></TD>
  74. </TR>
  75. <TR>
  76. <TD WIDTH=175 HEIGHT=99 COLSPAN=2> <a href="http://vpontier.free.fr/"><IMG SRC="ram/images/roubiotv-03.jpg" WIDTH=175 HEIGHT=99 border="0"></a></TD>
  77. <TD WIDTH=242 HEIGHT=187 ROWSPAN=2>
  78. <?
  79. /////////////////////////////////////////////////////////////////////////
  80. //  Affiche la video correspondante au choix si $ontv actif           ///
  81. /////////////////////////////////////////////////////////////////////////
  82.   if (!isset($ontv))
  83.        { echo "<IMG SRC='ram/images/noir.gif' WIDTH=242 HEIGHT=187></TD>";}
  84.   else {
  85.            $source_ram = $domaine.$chem_ram.$ontv.".ram";
  86.           print("<object id=screen height='$video_y' width='$video_x'
  87.                           classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA>
  88.                           <param name='SRC' value='$source_ram'>
  89.                           <param name='CONTROLS' value='ImageWindow'>
  90.                           <param name='AUTOSTART' value='true'>
  91.                           <embed type='audio/x-pn-realaudio-plugin'
  92.                           src='$source_ram'
  93.                           height='$video_y' width='$video_x' controls='ImageWindow'
  94.                           autostart='true' console='television'>
  95.                           </embed></object>" ); }
  96. ////////////////////////////////////////////////////////////////////////
  97. ?>
  98. <TD WIDTH=57 HEIGHT=208 ROWSPAN=3>
  99. <IMG SRC="ram/images/roubiotv-05.jpg" WIDTH=57 HEIGHT=208></TD>
  100. <TD WIDTH=1 HEIGHT=99>
  101. <IMG SRC="ram/images/espaceur.gif" WIDTH=1 HEIGHT=99></TD>
  102. </TR>
  103. <TR>
  104. <TD WIDTH=1 HEIGHT=109 ROWSPAN=2>
  105. <IMG SRC="ram/images/roubiotv-12.jpg" WIDTH=1 HEIGHT=109></TD>
  106. <TD WIDTH=174 HEIGHT=109 ROWSPAN=2>
  107. <IMG SRC="ram/images/roubiotv-07.jpg" WIDTH=174 HEIGHT=109></TD>
  108. <TD WIDTH=1 HEIGHT=88>
  109. <IMG SRC="ram/images/espaceur.gif" WIDTH=1 HEIGHT=88></TD>
  110. </TR>
  111. <TR>
  112. <TD WIDTH=242 HEIGHT=21>
  113. <IMG SRC="ram/images/roubiotv-08.jpg" WIDTH=242 HEIGHT=21></TD>
  114. <TD WIDTH=1 HEIGHT=21>
  115. <IMG SRC="ram/images/espaceur.gif" WIDTH=1 HEIGHT=21></TD>
  116. </TR>
  117. <TR>
  118. <TD WIDTH=175 HEIGHT=71 COLSPAN=2>
  119. <IMG SRC="ram/images/roubiotv-09.jpg" WIDTH=175 HEIGHT=71></TD>
  120. <TD WIDTH=242 HEIGHT=71 background="ram/images/roubiotv-10.jpg" valign="top">
  121. <form method="post" action="">
  122. <div align="center">
  123. <select class=relief name="ontv" onChange="MM_jumpMenu('parent',this,0)">
  124. <option value="<? echo"$domaine$chem_tv"; ?>">Aucune chaine sélectionnée</option>&nbsp;
  125. <option value="#" >--------------------------------</option>&nbsp;
  126. <?
  127. /////////////////////////////////////////////////////////////////////////////
  128. // Crée  la liste des fichier Realmédia disponible dans le select          //
  129. //  et création à la volée des fichiers (.ram) pour valider le streaming   //
  130. /////////////////////////////////////////////////////////////////////////////
  131.   for ($i=0; $i < count($entree); $i++)
  132.   {
  133.       if ($entree[$i] != "" )
  134.       { $Name = substr($entree[$i],0,(strlen($entree[$i])-3));
  135.     $Name_spaced=(ereg_replace("_"," ",$Name));
  136.  echo "<option value='$domaine$chem_tv$var_tv$Name'";
  137.  if ($Name == $ontv) {echo " selected";}
  138.  echo">$Name_spaced</option>";
  139.  $test_rm = $chem_ram.$Name.".ram";
  140.    
  141.  if (!file_exists($test_rm))
  142.    {
  143.      $streamer = fopen ("$test_rm" , "w+" );
  144.   $lien_rm = $domaine.$chem_rm.$entree[$i];
  145.   fputs($streamer, "$lien_rm" );
  146.   fclose ($streamer);
  147.           }
  148.        }
  149.     }
  150. /////////////////////////////////////////////////////////////////////////////
  151. ?>
  152. <option value="#">--------------------------------</option>
  153. </select>
  154. </div>
  155. </form>
  156. </TD>
  157. <TD WIDTH=57 HEIGHT=71>
  158. <IMG SRC="ram/images/roubiotv-11.jpg" WIDTH=57 HEIGHT=71></TD>
  159. <TD WIDTH=1 HEIGHT=71>
  160. <IMG SRC="ram/images/espaceur.gif" WIDTH=1 HEIGHT=71></TD>
  161. </TR>
  162. </TABLE>
  163. <div align="center"><font color="#FF9933"><br>
  164.   <font size="2"><b><font face="Verdana, Arial, Helvetica, sans-serif">D&eacute;mo
  165.   sur </font></b></font></font><font size="2"><b><font face="Verdana, Arial, Helvetica, sans-serif"><a href="http://vpontier.free.fr/?p=elroubio-tv" style="text-decoration: none"><font color="#FF6633">http://vpontier.free.fr/?p=elroubio-tv</font></a></font></b></font></div>


 
Pour ma part, J'ai ces messages d'erreur =  
 
Notice: Undefined variable: ma_liste in f:\site\realbox\realbox.php3 on line 47
Notice: Undefined variable: ontv in f:\site\realbox\realbox.php3 on line 155
 
Merci de votre aide car j'suis bloqué et de me dire ce que je dois modifier dans les variables...


Message édité par colorz le 24-10-2007 à 12:59:01
mood
Publicité
Posté le 24-10-2007 à 11:35:07  profilanswer
 

n°1629973
micfont999
Simplement Moi
Posté le 24-10-2007 à 11:41:57  profilanswer
 

bonjour
pourrais tu editer ton message et mettre le code entre les balises de code si possible :)  
ça sera plus clair pour nous .
Merci d'avance

n°1629988
dwogsi
Défaillance cérébrale...
Posté le 24-10-2007 à 11:48:13  profilanswer
 

Soit initialiser les variables avant de tenter de les lire (ou vérifier si elles le sont),
soit diminuer le niveau d'error_reporting dans ton php.ini (problème récurrent chez les utilisateurs de solutions à la easyPhp), faut chercher un peu.

Message cité 1 fois
Message édité par dwogsi le 24-10-2007 à 11:49:40

---------------
-- Debian -- Le système d'exploitation universel | Le gras c'est la vie! | /(bb|[^b]{2})/
n°1630001
micfont999
Simplement Moi
Posté le 24-10-2007 à 11:56:45  profilanswer
 

dwogsi a écrit :

Soit initialiser les variables avant de tenter de les lire (ou vérifier si elles le sont),
soit diminuer le niveau d'error_reporting dans ton php.ini (problème récurrent chez les utilisateurs de solutions à la easyPhp), faut chercher un peu.


 
+ 1
 
mais déjà ligne 47 --> $ma_liste .= "$entryName"."|" ;
 
Tu essai de mettre des choses au bout de $maliste (avec la concaténation . ) mais ma liste n'existe pas :)  
 
Donc $maliste = ""; avant le while serais déjà un plus ...  
 
Pour $ontv d'après ce que je vois la $var_tv = "ontv="; , je pense que c'est une variable à récuperer en $_GET[]
 
Voila :)

n°1630033
colorz
Posté le 24-10-2007 à 12:25:03  profilanswer
 

Merci j'arrive à voir mes videos mais j'ai ce nouveau message en haut:
 
Notice: Undefined index: ontv in f:\site\realbox\realbox.php3 on line 35
 
avec ce nouveau code :
 

Code :
  1. <?
  2. ///////////////////////////////////////////////
  3. //           REALBOX v1.0                    //
  4. //     Diffusion de fichiers                 //
  5. //          REAL MEDIA                       //
  6. ///////////////////////////////////////////////
  7. // http://vpontier.free.fr/                  //
  8. //      vpontier@free.fr                     //
  9. ///////////////////////////////////////////////
  10. //             PHP3                          //
  11. ///////////////////////////////////////////////
  12. // Il vous suffit de mettre vos              //
  13. // fichiers encodés en .rm dans              //
  14. // le sous-dossier rm et le tour             //
  15. // est joué....c'est tout !!                 //
  16. ///////////////////////////////////////////////
  17. //                                           //
  18. //      Démo sur El Roubio                   //
  19. //   http://vpontier.free.fr/?p=elroubio-tv  //
  20. //                                           //
  21. ///////////////////////////////////////////////
  22. /**********************************************
  23.            VARIABLES
  24. **********************************************/
  25. $domaine ="http://127.0.0.1/realbox/";
  26. $chem_ram = "ram/";
  27. $chem_rm = "ram/rm/";
  28. $chem_tv = "realbox.php3?";
  29. $var_tv = "ontv=";
  30. $video_x = "242";
  31. $video_y = "187";
  32. $ma_liste = "";
  33. $ontv = $_GET["ontv"];
  34. /*********************************************/
  35. ///////////////////////////////////////////////////////
  36. // Détecte les fichiers RealMédias dans le rep rm   ///
  37. ///////////////////////////////////////////////////////
  38. $myDirectory = opendir($chem_rm);
  39. while($entryName = readdir($myDirectory))
  40. {
  41.     if ($entryName !="." && $entryName !=".." )
  42. {
  43.     $ma_liste .= "$entryName"."|" ;
  44.     }
  45. }
  46. closedir($myDirectory);
  47. $ma_liste = substr($ma_liste,0,(strlen($ma_liste)-1));
  48. $entree = explode("|", $ma_liste);
  49. ///////////////////////////////////////////////////////
  50. // Plasse les .rm plus récents en premier           ///
  51. ///////////////////////////////////////////////////////
  52. function inverser( &$tableau ) {
  53. for($i = 0; $i < sizeof($tableau); $i++)
  54. $nTab[$i] = $tableau[ sizeof($tableau) - $i - 1];
  55. return $nTab; }
  56. $entree = inverser($entree);
  57. ///////////////////////////////////////////////////////
  58. ?>
  59. <script language="JavaScript">
  60. function MM_jumpMenu(targ,selObj,restore){
  61.   eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'" );
  62.   if (restore) selObj.selectedIndex=0;
  63. }
  64. </script>
  65. <body bgcolor="#660066">
  66. <center>
  67.   <h1><font color="#FF9933" face="Verdana, Arial, Helvetica, sans-serif">RealBox
  68.     v1.0</font></h1>
  69. </center>
  70. <TABLE WIDTH=474 BORDER=0 CELLPADDING=0 CELLSPACING=0 align="center">
  71. <TR>
  72. <TD WIDTH=474 HEIGHT=49 COLSPAN=4>
  73. <IMG SRC="ram/images/roubiotv.jpg" WIDTH=474 HEIGHT=49></TD>
  74. <TD WIDTH=1 HEIGHT=49>
  75. <IMG SRC="ram/images/espaceur.gif" WIDTH=1 HEIGHT=49></TD>
  76. </TR>
  77. <TR>
  78. <TD WIDTH=175 HEIGHT=99 COLSPAN=2> <a href="http://vpontier.free.fr/"><IMG SRC="ram/images/roubiotv-03.jpg" WIDTH=175 HEIGHT=99 border="0"></a></TD>
  79. <TD WIDTH=242 HEIGHT=187 ROWSPAN=2>
  80. <?
  81. /////////////////////////////////////////////////////////////////////////
  82. //  Affiche la video correspondante au choix si $ontv actif           ///
  83. /////////////////////////////////////////////////////////////////////////
  84.   if (!isset($ontv))
  85.        { echo "<IMG SRC='ram/images/noir.gif' WIDTH=242 HEIGHT=187></TD>";}
  86.   else {
  87.            $source_ram = $domaine.$chem_ram.$ontv.".ram";
  88.           print("<object id=screen height='$video_y' width='$video_x'
  89.                           classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA>
  90.                           <param name='SRC' value='$source_ram'>
  91.                           <param name='CONTROLS' value='ImageWindow'>
  92.                           <param name='AUTOSTART' value='true'>
  93.                           <embed type='audio/x-pn-realaudio-plugin'
  94.                           src='$source_ram'
  95.                           height='$video_y' width='$video_x' controls='ImageWindow'
  96.                           autostart='true' console='television'>
  97.                           </embed></object>" ); }
  98. ////////////////////////////////////////////////////////////////////////
  99. ?>
  100. <TD WIDTH=57 HEIGHT=208 ROWSPAN=3>
  101. <IMG SRC="ram/images/roubiotv-05.jpg" WIDTH=57 HEIGHT=208></TD>
  102. <TD WIDTH=1 HEIGHT=99>
  103. <IMG SRC="ram/images/espaceur.gif" WIDTH=1 HEIGHT=99></TD>
  104. </TR>
  105. <TR>
  106. <TD WIDTH=1 HEIGHT=109 ROWSPAN=2>
  107. <IMG SRC="ram/images/roubiotv-12.jpg" WIDTH=1 HEIGHT=109></TD>
  108. <TD WIDTH=174 HEIGHT=109 ROWSPAN=2>
  109. <IMG SRC="ram/images/roubiotv-07.jpg" WIDTH=174 HEIGHT=109></TD>
  110. <TD WIDTH=1 HEIGHT=88>
  111. <IMG SRC="ram/images/espaceur.gif" WIDTH=1 HEIGHT=88></TD>
  112. </TR>
  113. <TR>
  114. <TD WIDTH=242 HEIGHT=21>
  115. <IMG SRC="ram/images/roubiotv-08.jpg" WIDTH=242 HEIGHT=21></TD>
  116. <TD WIDTH=1 HEIGHT=21>
  117. <IMG SRC="ram/images/espaceur.gif" WIDTH=1 HEIGHT=21></TD>
  118. </TR>
  119. <TR>
  120. <TD WIDTH=175 HEIGHT=71 COLSPAN=2>
  121. <IMG SRC="ram/images/roubiotv-09.jpg" WIDTH=175 HEIGHT=71></TD>
  122. <TD WIDTH=242 HEIGHT=71 background="ram/images/roubiotv-10.jpg" valign="top">
  123. <form method="post" action="">
  124. <div align="center">
  125. <select class=relief name="ontv" onChange="MM_jumpMenu('parent',this,0)">
  126. <option value="<? echo"$domaine$chem_tv"; ?>">Aucune chaine sélectionnée</option>&nbsp;
  127. <option value="#" >--------------------------------</option>&nbsp;
  128. <?
  129. /////////////////////////////////////////////////////////////////////////////
  130. // Crée  la liste des fichier Realmédia disponible dans le select          //
  131. //  et création à la volée des fichiers (.ram) pour valider le streaming   //
  132. /////////////////////////////////////////////////////////////////////////////
  133.   for ($i=0; $i < count($entree); $i++)
  134.   {
  135.       if ($entree[$i] != "" )
  136.       { $Name = substr($entree[$i],0,(strlen($entree[$i])-3));
  137.     $Name_spaced=(ereg_replace("_"," ",$Name));
  138.  echo "<option value='$domaine$chem_tv$var_tv$Name'";
  139.  if ($Name == $ontv) {echo " selected";}
  140.  echo">$Name_spaced</option>";
  141.  $test_rm = $chem_ram.$Name.".ram";
  142.    
  143.  if (!file_exists($test_rm))
  144.    {
  145.      $streamer = fopen ("$test_rm" , "w+" );
  146.   $lien_rm = $domaine.$chem_rm.$entree[$i];
  147.   fputs($streamer, "$lien_rm" );
  148.   fclose ($streamer);
  149.           }
  150.        }
  151.     }
  152. /////////////////////////////////////////////////////////////////////////////
  153. ?>
  154. <option value="#">--------------------------------</option>
  155. </select>
  156. </div>
  157. </form>
  158. </TD>
  159. <TD WIDTH=57 HEIGHT=71>
  160. <IMG SRC="ram/images/roubiotv-11.jpg" WIDTH=57 HEIGHT=71></TD>
  161. <TD WIDTH=1 HEIGHT=71>
  162. <IMG SRC="ram/images/espaceur.gif" WIDTH=1 HEIGHT=71></TD>
  163. </TR>
  164. </TABLE>
  165. <div align="center"><font color="#FF9933"><br>
  166.   <font size="2"><b><font face="Verdana, Arial, Helvetica, sans-serif">D&eacute;mo
  167.   sur </font></b></font></font><font size="2"><b><font face="Verdana, Arial, Helvetica, sans-serif"><a href="http://vpontier.free.fr/?p=elroubio-tv" style="text-decoration: none"><font color="#FF6633">http://vpontier.free.fr/?p=elroubio-tv</font></a></font></b></font></div>


 
Je continu de cherché de mon coté  :)

n°1630059
dwogsi
Défaillance cérébrale...
Posté le 24-10-2007 à 12:37:12  profilanswer
 

C'est pourtant clair comme erreur...
Ligne 35 :
if(isset($_GET["ontv"])) $ontv = $_GET["ontv"]; else $ontv = '';


Message édité par dwogsi le 24-10-2007 à 12:37:23

---------------
-- Debian -- Le système d'exploitation universel | Le gras c'est la vie! | /(bb|[^b]{2})/
n°1630080
colorz
Posté le 24-10-2007 à 12:58:21  profilanswer
 

Non avec ce code marchai pas super alors j'ai mis un error_reporting(E_ALL ^ E_NOTICE); en haut et ça marche nikel maintenant.
 
Merci beaucoup je m'en serai jamais sorti tout seul.


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  PHP

  [Resolu] Problème sur realbox

 

Sujets relatifs
ma première page sur deamweaver : problème[VBA EXCEL] Problème avec partage de classeur !!
[Résolu] Soucis avec toggle Javascript Problème d'insertion dans une table sous oracle
[Résolu] Lister les fichiers d'un dossierProblème de conversion string en const char *
Problème de cookiesprobleme de dichotomie sur visual C++
Problème requête betweenProblème pour générer la DTD de fichiers XML
Plus de sujets relatifs à : [Resolu] Problème sur realbox


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR