0
Guys, somebody give me this help please ! I have a form where people go by youtube links containing songs and will generate for me a list of these songs in the file musicas.html.
How can I reverse the listing of these songs ? The file . html inserts each Youtube link below the other, and my need is for it to list one over the other, so it makes it easier not to have to scroll down in order to reach the last uploaded links.
<form action="" method="POST">
<input name="link" type="text" placeholder="Link do Youtube" />
<input type="submit" name="submit" value="Enviar">
</form>
<?php
if (!empty($_POST["link"])) {
$mus = $_POST['link'];
$arquivo = "musicas.html";
date_default_timezone_set('America/Bahia');
$data = date('d/m/Y H:i:s', time());
$fp = fopen($arquivo, "a+");
fwrite($fp,"Data: $data | Link: <a href=$mus>Click Aqui</a><br><br>");
fclose($fp);
echo "Música enviada com sucesso !";
}
?>
Extra doubt:
How do I blow this Youtube link to modify the video link and take it to a site link to download the . mp3 video ?
Example -> www.youtube.com/v=Abcdefgh_
Explode with modifications -> www.yout.com/v=Abcdefgh_
The site yout.com allows you to download . mp3 and . mp4 of the videos, so when I access my file musicas.html, I will have this result:
Date: 12/04/2016 17:51:21 | Link: Click Here | Download: Click Here
Thank you
You want to take only the value of the href attribute from the link ?
– Duque
That is, to modify the whole link of it: www.youtube.com/v=eXEmPLo_ For this: www.yout.com/v=example_
– André
Okay, I’ll post the solution.
– Duque