and the print_r of $_GET still gives an empty error?
Can you check the html code of the first page in your browser and post the link code here?
and the print_r of $_GET still gives an empty error?
Can you check the html code of the first page in your browser and post the link code here?
well i get undefined index for print_r for songs.i did posted the page code above,here i’ll do it again
<form action="single.php" method="post">
<div class="songslist">
<table class="songs" width="1020" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="281">Artist</th>
<th width="281">Title</th>
<th width="204">Length</th>
<th width="204">Genre</th>
<th width="50">Ratings</th>
</tr>
</table>
<table class="songs" width="1020" border="0" cellpadding="0" cellspacing="0">
<tr>
<?php
$songs = mysql_query("SELECT * FROM songs LIMIT 10");
if($songs){
echo mysql_error();
}
while($songs_set = mysql_fetch_array($songs)){
echo "<tr>
<td width=\\"281\\">".$songs_set["artist"]."</td>"
. "<td width=\\"281\\"><a href=\\"single.php?song={$songs_set['id']}\\">".$songs_set["title"]."</a></td>"
. "<td width=\\"204\\">".$songs_set["length"]."</td>"
. "<td width=\\"204\\">".$songs_set["genre"]."</td>"
. "<td width=\\"50\\">".$songs_set["rating"]."</td><tr>";
}
?>
</table>
</div>
</form>
and second page
print_r ($_POST['song']);
Why don’t you just do what I ask you?
The first time I asked you about $_GET, you changed things to $_REQUEST.
Now, you change things to $_POST.
Of course things don’t work. You send the data in the query string of the link, so $_POST is empty. You must use $_GET.
my bad… i m just lost. it worked so now can i use this id to put it in query to get information from the table?
p.s - thanks
Yes, I understand the feeling And it’s a good thing you’re not just waiting for answers, but also trying yourself. It’s just hard to help when the feedback says my suggestions didn’t work, while in reality they did work, but other changes created a new error (or even worse, the same error).
it worked
good
so now can i use this id to put it in query to get information from the table?
First you’ll have to sanitize it. If it’s supposed to be a number, cast it with (int). If it’s a string, put it through mysql_real_escape_string. And then you can use it in a query.
how i came to make it work yesterday is passing the variable and then putting it in mysql_query n echoing it. its working. now i have it. i m thinking of moving to wordpress.