<?php
if($_POST) {
$url = $_POST['txtUrl'];
$codigo = explode("=", $url);
$iframe='<iframe width="190" height="100" src="https://www.youtube.com/embed/'.$codigo[1].'" frameborder="0" allowfullscreen></iframe>';
echo $iframe;
}
?>
<!doctype html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Insertar video desde url</title>
</head>
<body>
<form action="" method="post" enctype="multipart/form-data">
<label for="video">Url del video: </label>
<input type="text" name="txtUrl" id="video">
<input type="submit" value="Subir">
</form>
</body>
</html>
Muestra un video de YouTube a partir de una url
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.