Ver Mensaje Individual
  #12 (permalink)  
Antiguo 18/09/2013, 17:39
Farrell
 
Fecha de Ingreso: septiembre-2013
Mensajes: 18
Antigüedad: 10 años, 7 meses
Puntos: 1
Respuesta: Procesar URL de Youtube!

Ya oe compare si quieres ayudas y si no, nadie te dice q' lo hagas! no me importa si tienes 5 0 10 años en esto, mejor ve una pelicula o algo y todo bien! suerte! yo busco ayuda!

Ahora , bueno ya lo tengo pero se me presento otro problema!
todo esta bien si el usuario ingresa solo una url de youtube ejemplo: http://www.youtube.com/watch?v=cdJIdclbeEg
pero si el usuario ingresa una url de youtube y ademas agrega texto en el mismo comentario ahi esta el problema, al imprimir solo se muestra el video y no el texto!
Ayudenme a solucionarlo please!

Aqui les dejo el codigo esta Bueno!
Cita:
<?php

function prossyoutube($text){

$height=250;

$width=250;

$OkThis='/[\\?\\&]v=([^\\?\\&]+)/';

if(preg_match($OkThis,$text,$okidoki))

{

if(strlen($vidid=$okidoki[1]) == 11){

$youtube="<object width=".$width." height=".$height."><param name=\"movie\" value=\"http://www.youtube.com/v/".$vidid."&hl=en&fs=1&rel=0\">

</param><param name=\"allowFullScreen\" value=\"true\">

</param><embed src=\"http://www.youtube.com/v/".$vidid."&hl=en&fs=1&rel=0\"

type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" width=".$width." height=".$height."></embed></object>";

return $youtube;

}else{

return $text;

}

}else{

return $text;

}

}
?>

<?php

$URL=trim($_POST['contenido']);
htmlentities($URL);

echo prossyoutube($URL);

?>

Última edición por Farrell; 18/09/2013 a las 17:44