how to get the word of the clicked link and send it to the page that the link sends

1

I do not know if the question was clear, but let's go. I have this code here:

<html>
	<head>
		<META CHARSET="UTF-8">
		<META NAME="author" VALUE="Fernando Aguiar Pinedo">
		<LINK REL="stylesheet" HREF="css.css">
		<LINK REL="shortcut icon" HREF="favicon.ico">
	</head>
	<body>
		<div id="cabeçalho">
			<h1>Music Downloader</h1>
			<p>Download Your Music Here</p>
		</div>
		<div id="filterlist">
			<ul>
				<h1 style="font-family:calibri; margin:5px; text-align:center;">Genre</h1>
				<li>Rock</li>
				<li>Eletronic</li>
				<li>Pop</li>
				<li>Reggae</li>
				<li>Hip Hop</li>
				<li>Anime</li>
				<li>Video Game</li>
			</ul>
			<ul>
				<h1 style="font-family:calibri; margin:5px; text-align:center;">Language</h1>
				<li>English</li>
				<li>Japanese</li>
				<li>French</li>
				<li>Brazilian</li>
				<li>Chinese</li>
				<li>German</li>
				<li>Spanish</li>
			</ul>
		</div>
		<div id="content"> <!--Conteúdo Aqui-->
			<?php
				include ("connectsql.php");
				$busca = "SELECT * FROM songs WHERE id < 11";
				$result = mysqli_query($link, $busca) or die(mysqli_error());
	
				if($result){
					while($song = mysqli_fetch_assoc($result)){
						echo "<div style=font-family:calibri;color:#FFFFFF;text-shadow:1px.3px.6px;display:inline-block;width:50%;>";
						echo "<a style='text-decoration:none;color:inherit;'href=http://localhost/sitededownload/pagdownload.php>
						<h2 style= margin:0px;margin-top:10px;>$song[Song]</h2>
						</a>";
						echo "<p style= margin:0;>$song[Artista]</p>";
						echo "</div>";
					}
				}
			?>
		</div> <!--Até Aqui-->
	</body>
</html>

I want to know how to get the word of the link I clicked on the tag inside php and put it as a title on page pagdownload.php .

Since there are several words on the page pagdownload.php that I need to link to a similar page, I thought about making a page only that changes according to the item that was clicked, but I do not know if it is possible.

    
asked by anonymous 20.02.2018 / 17:52

1 answer

0

You can pass the desired word as a parameter in the link and get the pagdownload.php

echo "<a style='text-decoration:none;color:inherit;'href=http://localhost/sitededownload/pagdownload.php?title={$song[Song]}'>
    <h2 style= margin:0px;margin-top:10px;>{$song[Song]}</h2>
</a>";

And in pagdownload.php you get this parameter using $_GET

$titulo = $_GET["title"];
    
20.02.2018 / 18:05