Jump to content

[SOLVED] A Few Questions


ThunderLee

Recommended Posts

Hi, I want to ask a few questions that I can't seem to find..

 

1) I'm creating a "shortcut" system on my website, where users can add shortcuts from pages by clicking the link and it will write the URL and the users ID into the database, the only problem I don't know how PHP can grab the URL of the page?

 

2) I can't seem to get cookies working on my site:

 

//get the posted values
$email1=($_POST['user_name']);
$email=htmlspecialchars($_POST['user_name'],ENT_QUOTES);
$pass=sha1($_POST['password']);
$post_autologin=($_POST['checkbox']);

//MYSQL
$abc = mysql_query("SELECT * FROM accounts WHERE email='".$email1."'") or die(mysql_error());
$a = mysql_fetch_array($abc);

//Select whatever..
$sql="SELECT user_id, email, password FROM accounts WHERE email='".$email."'";
$result=mysql_query($sql);
$row=mysql_fetch_array($result);

$userid = $a['user_id'];
$displayname = $a['display_name'];

$_SESSION['user_id']=$userid;
$_SESSION['email']=$email; 

//if username exists
if(mysql_num_rows($result)>0)
{
//compare the password
if(strcmp($row['password'],$pass)==0)
{
	echo "yes";
	if($post_autologin == YES)
	{
		$password_hash = sha1($pass); // will result in a 32 characters hash

		setcookie ($cookie_name, 'usr='.$email.'&hash='.$pass, time() + $cookie_time);
	}
	$_SESSION['user_id']=$userid;
	$_SESSION['email']=$email;
	$_SESSION['dname']=$displayname; 

}
else
	echo "no";
}
else
echo "no"; //Invalid Login


?>

 

Is this correct? Its a Ajax login I found but when I check the checkbox and close the browser it logs me out.. I use $_SESSION['user_id] in places where I want stuff to show for logged in users, where do I put $_COOKIE['user_id']???

 

http://mymediaupload.com/media.php?v=130 if you look on this page and click "More by Cheryl Cole" it shows the current song, how would I get it to view the rest of the songs by that artist and not the one thats playing?

 

This is what I have..

 

if($_GET['morelikethis'])
{
$name2 = mysql_real_escape_string($_GET['morelikethis']);		
$s = mysql_query("SELECT * FROM music WHERE musicartist LIKE '".$name2."%' ORDER BY `musicartist` ASC LIMIT 0,6") or die(mysql_error());
$t = mysql_query("SELECT * FROM music WHERE musicartist LIKE '".$name2."%' ORDER BY `musicartist` ASC") or die(mysql_error());
$u = mysql_query("SELECT * FROM music WHERE musicartist LIKE '".$name2."%' ORDER BY `musicartist` ASC LIMIT 1,5") or die(mysql_error());
$len = 19;

while($x = mysql_fetch_array($s))
{
	$q3 = mysql_query("SELECT * FROM accounts WHERE user_id = ".$x['musicuploaderid']."") or die(mysql_error());
	$q4 = mysql_fetch_array($q3);
	echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
	<tr>
	<td width=\"40\"><img src=\"".$x['musicalbumart']."\" height=\"40\" width=\"40\"></td><td width=\"5\"></td>";
	echo "<td align=\"left\" valign=\"top\"><a target=\"_top\" title=\"".$x['musictitle']." - ".$x['musicartist']."\" href=\"media.php?v=".$x['musicid']."\">";
	echo (strlen($x['musictitle']) > $len ? substr($x['musictitle'], 0, $len).".." : $x['musictitle']);
	echo "<br>";
	echo (strlen($x['musicartist']) > $len ? substr($x['musicartist'], 0, $len).".." : $x['musicartist']);
	echo "</a><br><a target=\"_top\" title=\"Click here to go to ".$q4['display_name']."'s Station\" href=\"stations.php?s=".$q4['user_id']."\">".$q4['display_name']."</a>";
	echo "</div></td>
	</tr>
	</table>";
	echo "<br><hr noshade color=\"#c0c0c0\"><br>";
}
if(mysql_num_rows($t)<=0)
{

	echo "<div id=\"content\">There is no results</div>";

}
if(mysql_num_rows($t)>=6)
{
	echo "<table width=\"90%\" align=\"center\"><tr><td><div id=\"sub4\">More..</div></td></tr></table>";
}
}

 

Thanks :D, BTW before you ask I did my research before I posted here.. for the first question I got something about ".$_SERVER[request_URI]."? But that didn't show the URL of that page on the page.. ?

Link to comment
Share on other sites

Ok Thanks, first question solved, How would I properly set the cookie?

 

"http://mymediaupload.com/media.php?v=130 if you look on this page and click "More by Cheryl Cole" it shows the current song, how would I get it to view the rest of the songs by that artist and not the one thats playing?

 

This is what I have.."

 

Sorry, this was ment to be a question too :P, I forgot to write 3).

Link to comment
Share on other sites

Hi thanks for your reply,

 

I found this Ajax login script on google, I'm not sure what the cookie name is, I just pasted everything from the ajax_login.php, It said in the instructions just to change the table/db/information to my settings but I don't see the cookies working. Here is the login box and stuff;

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script src="/js/jquery.js" type="text/javascript" language="javascript"></script>
<script language="javascript">
//  Developed by Roshan Bhattarai 
//  Visit http://roshanbh.com.np for this script and more.
//  This notice MUST stay intact for legal use

(function($) {

$(document).ready(function()
{
$("#login_form").submit(function()
{
	//remove all the class add the messagebox classes and start fading
	$("#msgbox").removeClass().addClass('messagebox').html('<span style="font-size: 9pt">Validating....</span>').fadeIn(1000);
	//check the username exists or not from ajax
	$.post("ajax_login.php",{ user_name:$('#username').val(),password:$('#password').val(),rand:Math.random() } ,function(data)
        {
	  if(data=='yes') //if correct login detail
	  {
	  	$("#msgbox").fadeTo(200,0.1,function()  //start fading the messagebox
		{ 
		  //add message and change the class of the box and start fading
		  $(this).html('<span style="font-size: 9pt">Logging in.....</span>').addClass('messageboxok').fadeTo(900,1,
              function()
		  { 
		  	
			document.location='index.php';
		  });
		  
		});
	  }
	  else 
	  {
	  	$("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
		{ 
		  //add message and change the class of the box and start fading
		  $(this).html('<span style="font-size: 9pt">Login details are incorrect. <a href="javascript:animatedcollapse.toggle(\'webregister\')" style="text-decoration: none">Need a account?</a></span>').addClass('messageboxerror').fadeTo(900,1);
		});		
          }

        });
		return false; //not to post the  form physically
});
//now call the ajax also focus move from 
$("#password").blur(function()
{
	$("#login_form").trigger('submit');
});
});


})(jQuery);

</script>
<style type="text/css">
.top {
margin-bottom: 15px;
}
.buttondiv {
margin-top: 10px;
}
.messagebox{
border:1px solid #c93;
background:#ffc;
font-weight:bold;
padding:3px;
}
.messageboxok{
border:1px solid #349534;
background:#C9FFCA;
font-weight:bold;
color:#008000;

}
.messageboxerror{
border:1px solid #CC0000;
background:#F7CBCA;
font-weight:bold;
color:#CC0000;
}

</style>
</head>
<body>
<form method="post" action="" id="login_form">
<div align="center">
<table align="center" cellpadding="2" cellspacing="0" width="301">
<tr>
<td colspan="2" height="48"><div align="center"><span id="msgbox" style="display:none"></span></div></td>
</tr>
<tr>
<td style="width:120px"><div align="left">
<div id="content">Email:</div></div></td>
<td><div align="left"><input name="username" class="input3" type="text" id="username" value="" maxlength="50" /></div></td>
</tr>
<tr>
<td style="width:120px"><div align="left"><div id="content">Password:</div></div></td>
<td><div align="left"><input name="password" class="input3" type="password" id="password" value="" maxlength="50" /></div></td>
</tr>
<tr>
<td colspan="2"><div align="right">
Remember Me? <input type="checkbox" name="checkbox" value="ON">  <input  name="Submit" id="submit" value="Login" type="image" class="submit-btn" src="http://www.roscripts.com/images/btn.gif" alt="submit" title="submit" />
</div></td>
</tr>
</table>
</form>
</body>
</html>

 

About the song, I didn't explain clearly sorry,

 

If you click "More From Cheryl" you will see 2 songs (The one that is playing right now and a remix version) I just want the other songs by that artist to display there but I don't want the song thats playing to display thus making the more from this artist more unique :P..

Link to comment
Share on other sites

I don't want the song thats playing to display thus making the more from this artist more unique :P..

 

Okay your need to update the query,

from

$s = mysql_query("SELECT * FROM music WHERE musicartist LIKE '".$name2."%' ORDER BY `musicartist` ASC LIMIT 0,6") or die(mysql_error());

to

$sql = sprintf("SELECT * FROM music WHERE musicartist LIKE '%s%' AND musicid !=%d ORDER BY `musicartist` ASC LIMIT 0,6",mysql_real_escape_string($name2), $_GET['v']);
$s = mysql_query($sql) or die(mysql_error());

that will list all songs except the one selected

 

as for the cookie,

add the following code at the start

$cookie_name = "user_id";
$cookie_time = 60*60*24*7; // 1 week

that should set the cookie to user_id and expire a week later

Link to comment
Share on other sites

oops

$sql = sprintf("SELECT * FROM music WHERE musicartist LIKE '%s%' AND musicid !=%d ORDER BY `musicartist` ASC LIMIT 0,6",mysql_real_escape_string($name2), $_GET['v']);
$s = mysql_query($sql) or die(mysql_error());

 

should be

$sql = sprintf("SELECT * FROM music WHERE musicartist LIKE '%%s%' AND musicid !=%d ORDER BY `musicartist` ASC LIMIT 0,6",mysql_real_escape_string($name2), $_GET['v']);
$s = mysql_query($sql) or die(mysql_error());

 

(missed a %)

Link to comment
Share on other sites

I rechecked my code and the code is the same as yours:

 

if($_GET['morelikethis'])
{
$name2 = mysql_real_escape_string($_GET['morelikethis']);		
$sql = sprintf("SELECT * FROM music WHERE musicartist LIKE '%%s%' AND musicid !=%d ORDER BY `musicartist` ASC LIMIT 0,6",mysql_real_escape_string($name2), $_GET['v']);
$s = mysql_query($sql) or die(mysql_error());
$t = mysql_query("SELECT * FROM music WHERE musicartist LIKE '".$name2."%' ORDER BY `musicartist` ASC") or die(mysql_error());
$u = mysql_query("SELECT * FROM music WHERE musicartist LIKE '".$name2."%' ORDER BY `musicartist` ASC LIMIT 1,5") or die(mysql_error());
$len = 19;

 

And I'm still getting the error :/

Link to comment
Share on other sites

Hi lol..

 

I updated it and still the same error o.o

 

	$name2 = mysql_real_escape_string($_GET['morelikethis']);		
$sql = sprintf("SELECT * FROM music WHERE musicartist LIKE '%%s%' AND musicid !=%d ORDER BY `musicartist` ASC LIMIT 0,6",$name2, $_GET['v']);
  	$s = mysql_query($sql) or die(mysql_error());
$t = mysql_query("SELECT * FROM music WHERE musicartist LIKE '".$name2."%' ORDER BY `musicartist` ASC") or die(mysql_error());
$u = mysql_query("SELECT * FROM music WHERE musicartist LIKE '".$name2."%' ORDER BY `musicartist` ASC LIMIT 1,5") or die(mysql_error());
$len = 19;

 

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''%sND musicid !=0 ORDER BY `musicartist` ASC LIMIT 0,6' at line 1

 

Do you need any more of the page code?

Link to comment
Share on other sites

Is that query ran via ajax ? if so does it pass the v parameter as it would seam that v isn't being passed.

 

Personally i like to pass ID's but this would also work

   $sql = sprintf("SELECT * FROM music WHERE musicartist LIKE '%s%%' AND musicartist !='%s' ORDER BY `musicartist` ASC LIMIT 0,6",$name2, $name2);

 

Link to comment
Share on other sites

That works but nothing is returned.

 

On the media page (media.php) this is the ifram that holds the more from artistname:

 

<iframe width="237" height="270" src="userapplet.php?morelikethis=<?php echo "".$m['musicartist'].""; ?>" name="morelikethis" border="0" frameborder="0"></iframe>

 

So in userapplet I would use the musicartist name from the URL. does it seem I need to take the musics id as well?

 

(If you can't seem to figure it out its ok I'll leave it as it may be causing as much stress as it is to me xP)

Link to comment
Share on other sites

Ok Here is userapplet.php

 

<link rel="stylesheet" href="css/MMUV1.css" type="text/css" media="screen" />

<!-- S H O W I N G  M O R E  M U S I C  F R O M  T H A T  U S E R -->

<?php

include("connectvars.php");

if($_GET['morefrom'])
{
$name = mysql_real_escape_string($_GET['morefrom']);		
$n = mysql_query("SELECT * FROM music WHERE musicuploaderid='".$name."' ORDER BY musicid DESC LIMIT 0,6") or die(mysql_error());
$o = mysql_query("SELECT * FROM music WHERE musicuploaderid='".$name."' ORDER BY musicid DESC") or die(mysql_error());
$q1 = mysql_query("SELECT * FROM accounts WHERE user_id = ".$name."") or die(mysql_error());
$q2 = mysql_fetch_array($q1);
$len = 19;
while($p = mysql_fetch_array($n))
{
	$q1 = mysql_query("SELECT * FROM accounts WHERE user_id = ".$name."") or die(mysql_error());
	$q2 = mysql_fetch_array($q1);
	echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
	<tr>
	<td width=\"40\"><img src=\"".$p['musicalbumart']."\" height=\"40\" width=\"40\"></td><td width=\"5\"></td>";
	echo "<td align=\"left\" valign=\"top\"><a target=\"_top\" title=\"".$p['musictitle']." - ".$p['musicartist']."\" href=\"media.php?v=".$p['musicid']."\">";
	echo (strlen($p['musictitle']) > $len ? substr($p['musictitle'], 0, $len).".." : $p['musictitle']);
	echo "<br>";
	echo (strlen($p['musicartist']) > $len ? substr($p['musicartist'], 0, $len).".." : $p['musicartist']);
	echo "</a><br><a target=\"_top\" title=\"Click here to go to ".$q2['display_name']."'s Station\" href=\"stations.php?s=".$q2['user_id']."\">".$q2['display_name']."</a>";
	echo "</div></td>
	</tr>
	</table>";
	echo "<br><hr noshade color=\"#c0c0c0\"><br>";

}
if(mysql_num_rows($o)<=0)
{

	echo "<div id=\"content\">There is no results</div>";

}
if(mysql_num_rows($o)>=6)
{
	echo "<table width=\"90%\" align=\"center\"><tr><td><div id=\"sub4\">More..</div></td></tr></table>";
}

}

?>

<!-- S H O W I N G  M O R E  M U S I C  F R O M  T H A T  A R T I S T -->

<?php

include("connectvars.php");

if($_GET['morelikethis'])
{
$name2 = mysql_real_escape_string($_GET['morelikethis']);		
   	$sql = sprintf("SELECT * FROM music WHERE musicartist LIKE '%s%%' AND musicartist !='%s' ORDER BY `musicartist` ASC LIMIT 0,6",$name2, $name2);
$s = mysql_query($sql) or die(mysql_error());
$t = mysql_query("SELECT * FROM music WHERE musicartist LIKE '".$name2."%' ORDER BY `musicartist` ASC") or die(mysql_error());
$u = mysql_query("SELECT * FROM music WHERE musicartist LIKE '".$name2."%' ORDER BY `musicartist` ASC LIMIT 1,5") or die(mysql_error());
$len = 19;

while($x = mysql_fetch_array($s))
{
	$q3 = mysql_query("SELECT * FROM accounts WHERE user_id = ".$x['musicuploaderid']."") or die(mysql_error());
	$q4 = mysql_fetch_array($q3);
	echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
	<tr>
	<td width=\"40\"><img src=\"".$x['musicalbumart']."\" height=\"40\" width=\"40\"></td><td width=\"5\"></td>";
	echo "<td align=\"left\" valign=\"top\"><a target=\"_top\" title=\"".$x['musictitle']." - ".$x['musicartist']."\" href=\"media.php?v=".$x['musicid']."\">";
	echo (strlen($x['musictitle']) > $len ? substr($x['musictitle'], 0, $len).".." : $x['musictitle']);
	echo "<br>";
	echo (strlen($x['musicartist']) > $len ? substr($x['musicartist'], 0, $len).".." : $x['musicartist']);
	echo "</a><br><a target=\"_top\" title=\"Click here to go to ".$q4['display_name']."'s Station\" href=\"stations.php?s=".$q4['user_id']."\">".$q4['display_name']."</a>";
	echo "</div></td>
	</tr>
	</table>";
	echo "<br><hr noshade color=\"#c0c0c0\"><br>";
}
if(mysql_num_rows($t)<=0)
{

	echo "<div id=\"content\">There is no results</div>";

}
if(mysql_num_rows($t)>=6)
{
	echo "<table width=\"90%\" align=\"center\"><tr><td><div id=\"sub4\">More..</div></td></tr></table>";
}
}

?>

 

And this is media.php.. (Scroll down to "viewing pages")

 

<?php include("header.php");

include("connectvars.php");

if($_GET['m']=="music")
{

?>

<title>Music | MyMediaUpload.com</title>
<tr>
<td width="960" background="images/BGHeadMiddle.png" colspan="7" valign="top">
<div align="center">
<table border="0" width="941" height="292" cellspacing="0" cellpadding="0">
<tr>
	<td height="0" valign="top" width="679">
	<table cellspacing="0" cellpadding="0">
<tr>
	<td height="0" width="5" valign="top"><img border="0" src="images/BC1.png"></td>
	<td height="0" width="29" background="images/BC2.png">
	<font color="#838383"><span style="font-size: 9pt">
	<a href="index.php" style="text-decoration: none">Home</a></span></font></td>
	<td height="0" width="17" valign="top">
	<img border="0" src="images/BC3.png" width="17" height="24"></td>
	<td height="0" width="31" background="images/BC2.png" nowrap>
	<font color="#838383"><span style="font-size: 9pt">
	<a href="media.php?m=music" style="text-decoration: none">Music</a></span></font></td>
	<td height="0" width="15"><img border="0" src="images/BC4.png"></td>
</tr>
	</table></td>
	<td height="0" valign="top" width="263" align="right">
	<?php

	if($_SESSION['email'])
	{?>

		<img src="images/ShortCut.png" border="0" /><a href="#" rel="toggle[bodyupload]" data-openimage="images/Upload1.png" data-closedimage="images/Upload2.png"><img src="images/Upload1.png" border="0" /></a>

	<?php
	}
	else
	{
	?>

		<img src="images/Upload4.png" border="0" />

	<?php
	}
	?>
</td>
</tr>	

<tr>
	<td height="5" width="941" valign="top" colspan="6">

<!-------------------------------------------------------------------------------------------------------------------------------------------->
<!------------------------------------------------- UPLOAD BOX DIV --------------------------------------------------------------------------->
<!-------------------------------------------------------------------------------------------------------------------------------------------->
	<?php include("uploadit.php"); ?>

	</td>
</tr>
<tr>
	<td height="263" width="941" valign="top" colspan="6" align="left">
	<table border="0" width="939" cellspacing="0" cellpadding="0">
	<tr>
		<td width="661" valign="top">
		<table border="0" width="940" height="0" cellspacing="0" cellpadding="0">
		<tr>
			<td height="0" width="0" background=""></td>
			<td height="0" width="935" bgcolor="#FFFFFF" valign="top">

			<iframe name="MUSICBOX" width="100%" height="430" scrolling="no" border="0" frameborder="0" src="/M/index.php" align="center">
			Oops! Your browser doesn't support "Inline Frames", choose a browser like FireFox/Internet Explorer or Google Chrome.
			</iframe></td>
			<td height="0" width="0"></td>
		</tr>
		</table></p>
		<table border="0" width="942" height="153" cellspacing="0" cellpadding="0">
		<tr>
			<td height="11" width="6"><img border="0" src="images/UL1.png" width="6" height="11"></td>
			<td height="11" width="930" background="images/UM1.png"></td>
			<td height="11" width="6"><img border="0" src="images/UR1.png" width="6" height="11"></td>
		</tr>
		<tr>
			<td height="1" width="6" background="images/LL.png"> </td>
			<td height="1" width="930" bgcolor="#FFFFFF" valign="top"><div id="content">Featured Music:</div>
			<iframe name="Recent" width="930" height="207" scrolling="no" border="0" frameborder="0" src="/T/indexM.php" align="center">Oops! Your browser doesn't support "Inline Frames", choose a browser like FireFox/Internet Explorer or Google Chrome.</iframe></td>
			<td height="1" width="6" background="images/RR.png"> </td>
		</tr>
		<tr>
			<td height="11" width="6"><img border="0" src="images/DL.png" width="6" height="11"></td>
			<td height="0" width="930" background="images/DM.png"></td>
			<td height="11" width="6"><img border="0" src="images/DR.png" width="6" height="11"></td>
		</tr>
		</table>
		 
<!------------------------------------------ 
EMPTY SPACE BELOW LEFT TABLE <<<<<<<<<<<<<<<
-------------------------------------------->

		</td>
	</tr>
	</table>
	</td>
</tr>
</table>
<!------------------------------------------ 
EMPTY SPACE BELOW ALL TABLES AND ABOVE LINE
-------------------------------------------->
</div>
</td>
</tr>
<?php 

include("footer.php");

?>
<!------------------------------------------------------------------------------------------------------------------------------------------------->
<!------------------------------------------------------------------------------------------------------------------------------------------------->
<!------------------------------------------------------------ VIEWING SONG PAGES ----------------------------------------------------------------->
<!------------------------------------------------------------------------------------------------------------------------------------------------->
<!------------------------------------------------------------------------------------------------------------------------------------------------->
<?php

}
elseif($_GET['v'])
{


$name = mysql_real_escape_string($_GET['v']);		
$dd = mysql_query("SELECT * FROM `music` WHERE `musicid`='".$name."'") or die(mysql_error());
$m = mysql_fetch_array($dd);
$cc = mysql_query("SELECT * FROM `accounts` WHERE `user_id`='".$m['musicuploaderid']."'") or die(mysql_error());
$c = mysql_fetch_array($cc);
$update = mysql_query("UPDATE `music` SET `views` = views + 1 WHERE `musicid`='".$name."'") or die(mysql_error());

$len = 25;

?>
<?php echo "<title>".$m['musictitle']." - ".$m['musicartist']." | MyMediaUpload.com</title>"; ?>
<tr>
<td width="960" background="images/BGHeadMiddle.png" colspan="7" valign="top">
<div align="center">
<table border="0" width="941" height="292" cellspacing="0" cellpadding="0">
<tr>
	<td height="0" valign="top" width="663">
	<table cellspacing="0" cellpadding="0">
<tr>
	<td height="0" width="5" valign="top"><img border="0" src="images/BC1.png"></td>
	<td height="0" width="29" background="images/BC2.png">
	<font color="#838383"><span style="font-size: 9pt">
	<a href="index.php" style="text-decoration: none">Home</a></span></font></td>
	<td height="0" width="17" valign="top">
	<img border="0" src="images/BC3.png" width="17" height="24"></td>
	<td height="0" width="31" background="images/BC2.png" nowrap>
	<font color="#838383"><span style="font-size: 9pt">
	<a href="media.php?m=music" style="text-decoration: none">Music</a></span></font></td>
	<td height="0" width="17">
	<img border="0" src="images/BC3.png" width="17" height="24"></td>
	<td height="0" width="0" background="images/BC2.png" nowrap><div id="content"><?php echo "".$m['musictitle']." - ".$m['musicartist'].""; ?></div></td>
	<td height="0" width="15">		
	<img border="0" src="images/BC4.png"></td>
</tr>
	</table></td>
	<td height="0" valign="top" width="278" align="right">
	<?php

	if($_SESSION['email'])
	{?>

		<a href="?v=<?php echo "".$m['musicid'].""; ?>&func=shortcutadd"><img src="images/ShortCut.png" border="0" /></a><a href="#" rel="toggle[bodyupload]" data-openimage="images/Upload1.png" data-openimage="images/Upload1.png" data-closedimage="images/Upload2.png"><img src="images/Upload1.png" border="0" /></a>

	<?php
	}
	else
	{
	?>

		<img src="images/Upload4.png" border="0" />

	<?php
	}
	?>
</td>
</tr>	
<tr>		<td height="5" width="941" valign="top" colspan="2">

<!-------------------------------------------------------------------------------------------------------------------------------------------->
<!------------------------------------------------- UPLOAD BOX DIV --------------------------------------------------------------------------->
<!-------------------------------------------------------------------------------------------------------------------------------------------->
	<?php include("uploadit.php"); ?>

	</td>
</tr>
<tr>
	<td height="263" width="941" valign="top" align="left" colspan="2">
	<?php

	if($_GET['func']=='favthis')
	{

	$ucheck = mysql_query("SELECT * FROM `fav` WHERE `uid`='".$_SESSION['user_id']."' AND `musicid`='".$m['musicid']."'") or die(mysql_error());

	if(mysql_num_rows($ucheck) >= 1)
	{
		echo "<table width=\"95%\" align=\"center\"><tr><td><div id=\"error2\" align=\"center\">The song ".$m['musictitle']." is already in your favourites (<a href=\"?v=".$m['musicid']."&func=removefav\">Remove?</a>).</div></a><div id=\"content\"></div></td></tr></table></div><br>";
	}
	else	
	{

		mysql_query("INSERT INTO `fav` (`uid`,`musicid`,`date`) VALUES ('".$_SESSION['user_id']."','".$m['musicid']."',now())") or die(mysql_error()); 

		echo "<table width=\"95%\" align=\"center\"><tr><td><div id=\"error1\" align=\"center\">The song ".$m['musictitle']." has been added to your favourites.</div></a></td></tr></table></div><br>";
	}

	}

	if($_GET['func']=='removefav')
	{

		mysql_query("DELETE FROM `fav` WHERE `uid`='".$_SESSION['user_id']."' AND `musicid`='".$m['musicid']."'") or die(mysql_error()); 

		echo "<table width=\"95%\" align=\"center\"><tr><td><div id=\"error4\" align=\"center\">The song ".$m['musictitle']." has been removed from your favourites.</div></a><div id=\"content\"></div></td></tr></table></div><br>";
	}


	?>
	<table border="0" width="939" cellspacing="0" cellpadding="0" height="403">
	<tr>
		<td width="247" valign="top" rowspan="2">
		<table border="0" width="247" height="0" cellspacing="0" cellpadding="0">
		<tr>
			<td height="28" width="6"><img border="0" src="images/UL.png" width="6" height="28"></td>
			<td height="28" width="235" background="images/UM.png" colspan="2"><div id="header3">Subscribe();</div></td>
			<td height="28" width="6"><img border="0" src="images/UR.png" width="6" height="28"></td>
		</tr>
		<tr>
			<td height="0" width="6" background="images/LL.png" rowspan="3"> </td>
			<td height="29" width="97" bgcolor="#FFFFFF" valign="top">
			<p align="center">
			<img src="<?php echo "".$c['display_picture'].""; ?>" height="90" width="90" align="center"></td>
			<td height="29" width="138" bgcolor="#FFFFFF" valign="top">
			<div id="content"><b><?php echo "".$c['display_name'].""; ?></b><br>

			<?php 

			echo date("D d M Y",strtotime($m['dateadded'])); ?><br><br><b>Views:</b> <?php echo "".$m['views'].""; ?><br><b>Rating:</b> <?php echo "".$m['rating'].""; ?><br><b>Media:</b> Music</div></td>
			<td height="0 width="6" background="images/RR.png" rowspan="3"> </td>
		</tr>
		<tr>
			<td height="3" width="235" bgcolor="#FFFFFF" valign="top" colspan="2">
			</td>
			</tr>
		<tr>
			<form name="form"><td height="0" width="235" bgcolor="#FFFFFF" valign="top" colspan="2">



			<div id="content0"><table width="234"><tr><td>
			<a href="javascript:animatedcollapse.toggle('contactuser')"><div id="sub4">Contact <?php echo "".$c['display_name'].""; ?></div></a>
			<div id="content"><div id="contactuser"><?php echo "<br>PM ".$c['display_name']."<br>Email ".$c['display_name'].""; ?><br></div></div></td></tr></table>
			<table width="234"><tr><td><?php

			$abc = mysql_query("SELECT * FROM `accounts` WHERE `email`='".$_SESSION['email']."'") or die(mysql_error());
			$z = mysql_fetch_array($abc);

			if($z['admin']=="1")
			{

				echo "<a href=\"javascript:animatedcollapse.toggle('adminoptionmedia')\"><div id=\"sub4\">Administrator Options</div></a><div id=\"content\"><div id=\"adminoptionmedia\"><br><a href=\"".$m['musiclocation']."\">Download</a><br></div></div>";

			}

			?></td></tr></table>
			<table width="234"><tr><td><?php

			if($z['mod']=="1")
			{

				echo "<a href=\"javascript:animatedcollapse.toggle('modoptionmedia')\"><div id=\"sub4\">Moderator Options</div></a><div id=\"content\"><div id=\"modoptionmedia\"><br><a href=\"".$m['musiclocation']."\">Download</a><br></div></div><br>";

			}

			?></td></tr></table>

<script language="JavaScript" type="text/javascript">
<!--
function copyText(frm) {
if (!document.all) return; // IE only
r = document.selection.createRange();
copyStr=r.text;
frm.temp.value=copyStr
r=frm.temp.createTextRange();
r.execCommand('copy');
frm.ins.focus;//this and the two lines below are just to show that it works
r=frm.ins.createTextRange();
r.execCommand('paste');
}
//-->
</script>

			<div id="content"> Page URL <a href="javascript:HighlightAll('form.post')">(Select All)</a></div>
			<div align="center"><form name="form"><input type="text" class="input4" value="http://www.mymediaupload.com/media.php?v=<?php echo "".$m['musicid'].""; ?>" name="post"></input></div></td></form>
			</tr>
		<tr>
			<td height="11" width="6"><img border="0" src="images/DL.png" width="6" height="11"></td>
			<td height="0" width="235" background="images/DM.png" colspan="2"></td>
			<td height="11" width="6"><img border="0" src="images/DR.png" width="6" height="11"></td>
		</tr>
		</table>
		<font face="Arial" style="font-size: 6pt"> 

		<table border="0" width="246" height="40" cellspacing="0" cellpadding="0">
		<tr>
			<td height="11" width="6"><img border="0" src="images/UL1.png" width="6" height="11"></td>
			<td height="11" width="234" background="images/UM1.png"></td>
			<td height="11" width="6"><img border="0" src="images/UR1.png" width="6" height="11"></td>
		</tr>
		<tr>
			<td height="18" width="6" background="images/LL.png"></td>
			<td height="18" width="235" bgcolor="#FFFFFF" valign="top"><a href="javascript:animatedcollapse.toggle('morefromuser')">More 
			From <?php echo "".$c['display_name'].""; ?></a></td>
			<td height="18" width="6" background="images/RR.png"></td>
		</tr>
		<tr>
			<td height="11" width="6"><img border="0" src="images/DL.png" width="6" height="11"></td>
			<td height="0" width="234" background="images/DM.png"></td>
			<td height="11" width="6"><img border="0" src="images/DR.png" width="6" height="11"></td>
		</tr>
		</table>
		<table height="0"><tr><td>
		<div id="morefromuser">
		<font face="Arial" style="font-size: 6pt"> </font>
		<iframe width="237" height="270" src="userapplet.php?morefrom=<?php echo "".$c['user_id'].""; ?>" name="morebyuser" border="0" frameborder="0"></iframe></div>
		</td></tr></table><br>
		<table border="0" width="246" height="40" cellspacing="0" cellpadding="0">
		<tr>
			<td height="11" width="6"><img border="0" src="images/UL1.png" width="6" height="11"></td>
			<td height="11" width="234" background="images/UM1.png"></td>
			<td height="11" width="6"><img border="0" src="images/UR1.png" width="6" height="11"></td>
		</tr>
		<tr>
			<td height="18" width="6" background="images/LL.png"></td>
			<td height="18" width="235" bgcolor="#FFFFFF" valign="top"><a href="javascript:animatedcollapse.toggle('morelikethis')">Music From <?php echo "".$m['musicartist'].""; ?></a></td>
			<td height="18" width="6" background="images/RR.png"></td>
		</tr>
		<tr>
			<td height="11" width="6"><img border="0" src="images/DL.png" width="6" height="11"></td>
			<td height="0" width="234" background="images/DM.png"></td>
			<td height="11" width="6"><img border="0" src="images/DR.png" width="6" height="11"></td>
		</tr>
		</table>
<!------------------------------------------ 
EMPTY SPACE BELOW LEFT TABLE <<<<<<<<<<<<<<<
-------------------------------------------->
		<font face="Arial" style="font-size: 6pt"> 
		<div id="morelikethis">
		<font face="Arial" style="font-size: 6pt"> </font>
		<iframe width="237" height="270" src="userapplet.php?morelikethis=<?php echo "".$m['musicartist'].""; ?>" name="morelikethis" border="0" frameborder="0"></iframe></div></td>
		<td height="226" width="10"> </td>
		<td height="226" width="684" valign="top">

		<table border="0" width="683" height="226" cellspacing="0" cellpadding="0">
		<tr>
			<td height="28" width="6"><img border="0" src="images/LeftUR.png" width="6" height="29"></td>
			<td height="28" width="0" background="images/LeftUM.png" nowrap colspan="5"><b><span style="font-size: 10pt"><?php echo "".$m['musictitle']." - ".$m['musicartist'].""; ?></span></b>
			<span style="font-size: 9pt">| <a href="?v=<?php echo "".$m['musicid'].""; ?>&func=favthis">Favourite</a> | Share</span><table width="152" height="1" align="right"><tr><td align="center"><div id="sub1">Buy this song on iTunes</div></td></tr></table></td>
			<td height="28" width="6"><img border="0" src="images/LeftUL.png" width="6" height="29"></td>
		</tr>
		<tr>
			<td height="0" width="6" background="images/LL.png" rowspan="3"></td>
			<td height="0" width="6" bgcolor="#FFFFFF" align="left" valign="top" rowspan="2"></td>
			<td width="165" bgcolor="#FFFFFF" align="left" valign="top" height="124">
			<span style="font-size: 6.2pt"> </span><div id="content"><div id="sub3">Song Title</div>
			<?php 
			echo (strlen($m['musictitle']) > $len ? substr($m['musictitle'], 0, $len)."..." : $m['musictitle']);
			?><br><br><div id="sub3">Album</div><?php echo "".$m['musicalbum'].""; ?><br><br></div></td>
			<td width="10" bgcolor="#FFFFFF" align="left" valign="top" height="124"> </td>
			<td width="175" bgcolor="#FFFFFF" align="left" valign="top" height="124">
			<span style="font-size: 6.2pt"> </span><div id="content"><div id="sub3">Artist</div>
			<?php 
			echo (strlen($m['musicartist']) > $len ? substr($m['musicartist'], 0, $len)."..." : $m['musicartist']);
			?><br><br><div id="sub3">Genre</div><?php echo "".$m['musicgenre'].""; ?></div></td>
			<td width="315" bgcolor="#FFFFFF" align="center" rowspan="3">

			<!----------------------------->	
			<!-- START WIMPY PLAYER CODE -->
			<!----------------------------->	

			<span style="font-size: 5pt">   </span><div id="waspTarget0910222609"><a href="http://www.adobe.com/products/flashplayer/">Flash Player upgrade required</a></div>

			<script language="javascript">

			// <![CDATA[

			var waspConfigs0910222609 = new Object();

			waspConfigs0910222609.instanceID="0910222609";

			waspConfigs0910222609.waspSwf="wasp.swf";

			waspConfigs0910222609.pageColor="FFFFFF";

			waspConfigs0910222609.fp=""; //Media.php

			waspConfigs0910222609.fa=""; //PreRoll

			waspConfigs0910222609.im=""; //Poster

			waspConfigs0910222609.v="50";

			waspConfigs0910222609.vo="<?php echo "".$m['musicalbumart'].""; ?>";

			waspConfigs0910222609.f="<?php echo "".$m['musiclocation'].""; ?>"; // Path to file

			waspConfigs0910222609.a="1";

			waspConfigs0910222609.me="0";

			waspConfigs0910222609.ph="320";

			waspConfigs0910222609.pw="300";

			waspConfigs0910222609.waspSkin="sr_1|2|||C8C8C8|E8E8E8^st_1|2|16||000000||FFFFFF^sg_1|1|18^sb_1|4|20|edf4fe|FFFFFF|d9e8fe^sp_1|5|17|D0D0D0|909090|99CCFF^sv_1|2||C8C8C8|C8C8C8|E8E8E8^sw_1|1|18^sm_1|5|17|D0D0D0|909090|99CCFF^sf_1|5|17|D0D0D0|909090|99CCFF^ss_1|5|17|D0D0D0|909090|99CCFF";

			writeWasp(waspConfigs0910222609);

			// ]]>

			</script>

			<!--------------------------->	
			<!-- END WIMPY PLAYER CODE -->
			<!--------------------------->	

			</td>
			<td height="0" width="6" background="images/RR.png" rowspan="3"></td>
		</tr>
		<tr>
			<td width="350" bgcolor="#FFFFFF" align="left" valign="top" rowspan="2" colspan="3">
			<div id="content">&Lyrics();</div></td>
			</tr>
		<tr>
			<td height="0" width="6" bgcolor="#FFFFFF" align="left" valign="top"></td>
		</tr>
		<tr>
			<td height="11" width="6"><img border="0" src="images/DL.png" width="6" height="11"></td>
			<td height="0" width="671" background="images/DM.png" colspan="5"></td>
			<td height="11" width="6"><img border="0" src="images/DR.png" width="6" height="11"></td>
		</tr>
		</table>
	</tr>
	<tr>
		<td height="177" width="8"> </td>
		<td width="684" valign="top"><span style="font-size: 6pt"> 
		</span>
		<table border="0" width="100%" height="154" cellspacing="0" cellpadding="0">
		<tr>
			<td height="29" width="6"><img border="0" src="images/LeftUR.png" width="6" height="29"></td>
			<td height="29" width="672" background="images/LeftUM.png"><div id="header">Comments</div></td>
			<td height="29" width="6"><img border="0" src="images/LeftUL.png" width="6" height="29"></td>
		</tr>
		<tr>
			<td height="114" width="6" background="images/LL.png"></td>
			<td height="114" width="672" bgcolor="#FFFFFF" valign="top">
			<div id="content"><br>
	<?php 


	$a = mysql_query("SELECT * FROM comments WHERE mid='".$m['musicid']."' AND rid='0'") or die(mysql_error());
	$be = mysql_query("SELECT * FROM comments WHERE uid='".$m['musicuploaderid']."'") or die(mysql_error());
	$ee = mysql_fetch_array($be);
	while($v = mysql_fetch_array($a))
	{

	$b = mysql_query("SELECT * FROM comments WHERE mid='".$m['musicid']."' AND comid='".$v['cid']."'") or die(mysql_error());
	$set = mysql_query("SELECT * FROM accounts WHERE user_id='".$v['uid']."'") or die(mysql_error());
	$s = mysql_fetch_array($set);

	?>

	<table align="center" border="1" width="90%" height="0" cellspacing="0" cellpadding="0" bordercolor="#FFCC66" style="border-collapse: collapse">
	<tr>
		<td height="0" width="90%" bordercolor="#FFFF66" bgcolor="#FFFFCC" bordercolorlight="#FFFF00" bordercolordark="#FFFF00" valign="top">
		<div id="content"><span style="font-size: 2pt"> </span><br> <?php echo "".$s['display_name']." - "; ?><?php echo date("D d M Y",strtotime($v['date'])); ?> 
		<?php

		if($_SESSION['user_id'])
		{

		if($m['musicuploaderid'] == $_SESSION['user_id'])
		{

			if($v['uid'] == $_SESSION['user_id'])
			{

			echo "( <a href=\"#\">Delete</a> )</div>";

			}
			else
			{

				echo "( <a href=\"#\">Delete</a> | <a href=\"#\">Spam</a> )</div>";
			}

		}
		elseif($z['admin']=="1" || $z['mod']=="1")
		{
			echo "( <a href=\"#\">Delete</a> | <a href=\"#\">Spam</a> )</div>";

		}
		elseif($v['uid'] == $_SESSION['user_id'])
		{

			echo "( <a href=\"#\">Delete</a> )</div>";

		}
		else
		{
			echo "( <a href=\"#\">Spam</a></div> )";

		}

		}

		?>
		<div id="container0">
		<form method="post" id="registerForm0" action="http://www.mymediaupload.com/register.php">
	    	<table align="center" cellpadding="2" cellspacing="0" width="98%" height="0">
	    	<tr>
	    		<td><br><div align="left" id="content1"><?php echo "".$v['comment'].""; ?></div><br><br>

			<?php

			while($y = mysql_fetch_array($b))
			{

				$tt = mysql_query("SELECT * FROM accounts WHERE user_id='".$y['uid']."'") or die(mysql_error());
				$t = mysql_fetch_array($tt);?>

				<table align="center" border="1" width="90%" height="0" cellspacing="0" cellpadding="0" bordercolor="#FFCC66" style="border-collapse: collapse">
				<tr>
				<td height="0" width="90%" bordercolor="#FFFF66" bgcolor="#FFE09F" bordercolorlight="#FFFF00" bordercolordark="#FFFF00" valign="top">
				<div id="content"><span style="font-size: 2pt"> </span><br> <?php echo "".$t['display_name']." - "; ?><?php echo date("D d M Y",strtotime($y['date'])); ?> 
				<?php

				if($_SESSION['user_id'])
				{

					if($m['musicuploaderid'] == $_SESSION['user_id'])
					{

						if($v['uid'] == $_SESSION['user_id'])
						{

							echo "( <a href=\"#\">Delete</a> )</div>";

						}
						else
						{

							echo "( <a href=\"#\">Delete</a> | <a href=\"#\">Spam</a> )</div>";
						}

					}
					elseif($z['admin']=="1" || $z['mod']=="1")
					{
						echo "( <a href=\"#\">Delete</a> | <a href=\"#\">Spam</a> )</div>";

					}
					elseif($v['uid'] == $_SESSION['user_id'])
					{

						echo "( <a href=\"#\">Delete</a> )</div>";

					}
					else
					{
						echo "( <a href=\"#\">Spam</a></div> )";

					}
				}?>

				<div id="container0">
				<form method="post" id="registerForm0" action="http://www.mymediaupload.com/register.php">
	    			<table align="center" cellpadding="2" cellspacing="0" width="98%">
	    			<tr>
	    				<td><br><div align="left" id="content1"><?php echo "".$y['comment'].""; ?><br><br></div></td>
	    			</tr>
	    			</table>
	    			</form>
	    			</div>

				<div align="right">

				</span></font>
				<table border="0" width="100%" height="0" cellspacing="0" cellpadding="0">
				<tr>
					<td height="0" width="614"><div id="content"> + / - (--)</div></td>
				</tr>
				</table></div>
				</td>
			</tr>
			</table>
			<br>

			<?php } ?>
			</td>
	    	</tr>
	    	</table>
	    	</form>
	    	</div>

			<div align="right">
		<script type="text/javascript">
		animatedcollapse.addDiv('replycomment<?php echo "".$v['cid'].""; ?>', 'fade=0,hide=1')	
		animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted
//$: Access to jQuery
//divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID
//state: "block" or "none", depending on state
}

animatedcollapse.init()

</script>
		</span></font>
	<table border="0" width="100%" height="0" cellspacing="0" cellpadding="0">
<tr>
	<td height="0" width="614"><div id="content"> + / - (--)<br></div><span style="font-size: 2pt"> </span></td>
	<td height="0" width="713"><div id="content" align="right">
	<?php
	if($_SESSION['user_id'])
	{?>
		<a href="javascript:animatedcollapse.toggle('replycomment<?php echo "".$v['cid'].""; ?>')">Reply </a>
	<?php 
	} 
	?></div></td>
</tr>
</table></div>

	<?php
	if($_SESSION['user_id'])
	{?>

	<div id="replycomment<?php echo "".$v['cid'].""; ?>">
	<div id="header"><br>Replying to <?php echo "".$s['display_name'].""; ?></div><br>

	<div align="center">
	<form action="comment.php?replyto=<?php echo "".$s['user_id'].""; ?>" method="post">
	<input type="hidden" name="mid" value="<?php echo "".$m['musicid'].""; ?>"><input type="hidden" name="comid" value="<?php echo "".$v['cid'].""; ?>"><textarea rows="2" class="input2-1" name="comment" cols="60"></textarea><br><input type="submit" value="Submit" name="Comment" onclick="this.disabled=true,this.form.submit();" />

	</form></div></div>

	<?php
	}
	?>
</td>
	</tr>
	</table><br>


	<?php

	}

	?>

	<div id="webcomment">
	<div align="center">

	<table border="1" width="90%" height="61" cellspacing="0" cellpadding="0" bordercolor="#FFCC66" style="border-collapse: collapse">
	<tr>
		<td height="55" width="0" bordercolor="#FFFF66" bgcolor="#FFFFCC" bordercolorlight="#FFFF00" bordercolordark="#FFFF00" valign="top">

<?php

if($_SESSION['email'])
{

if($_GET['func']=='post_comment')
{

	$rr = mysql_query("SELECT * FROM accounts WHERE email='".$_SESSION['email']."'") or die(mysql_error());
	$r = mysql_fetch_array($rr);

	$found = mysql_query("SELECT * FROM `comments` WHERE `mid`='".$_POST['mid']."'") or die(mysql_error());
	$grab = mysql_fetch_array($found);
	$seconds = 60;
	if((time()-$seconds) < $grab['dateadded']) 
	{
		$errors[] = "You may only send a comment every 1 minute.";
	}
	elseif ($_POST['comment']=='')
	{
		$errors[] = 'Please enter a comment';
	}

	if(is_array($errors))
	{
		echo '<div id="content" class="error">';
		while (list($key,$value) = each($errors))
		{

			echo ''.$value.'<br />';
		}
		echo '</div>';
	}
	else
	{

		$rr = mysql_query("SELECT * FROM accounts WHERE email='".$_SESSION['email']."'") or die(mysql_error());
		$r = mysql_fetch_array($rr);

		$comment = mysql_real_escape_string($_POST['comment']);
		$uid = mysql_real_escape_string($r['user_id']);
		$mid = mysql_real_escape_string($_POST['mid']);
		$time = date("h:i A");
		$date = date("m/d/y");
		$fulltime = "".$time." · ".$date."";

		$ia = mysql_query("INSERT INTO `comments` (`comment`,`uid`,`date`,`datetime`,`mid`,`e`) VALUES ('".$comment."','".$uid."',now(),'".$fulltime."','".$mid."','".$_SESSION['email']."')") or die(mysql_error());
		echo "<p><b>Your comment has been posted!</b><br>(You may need to refresh to see your comment)</p>";

	}

}
else
{?>

	<div id="header"><br>Please leave a comment,</div><br>

	<div align="center">

	<form action="comment.php" method="post">

	<input type="hidden" name="mid" value="<?php echo "".$m['musicid'].""; ?>"><textarea rows="2" class="input2" name="comment" cols="60"></textarea><br><input type="submit" value="Submit" name="Comment" onclick="this.disabled=true,this.form.submit();" />

	</form>

<?php

}

}
else
{

echo "<div align=\"center\" id=\"content\"><br>You must be logged in to comment on this song.";

}
?>


	        </div>

	    </div>

		</span></font>
		</td>
	</tr>
	</table>


	<br>
	</div></div>
	</td>
	<td height="114" width="6" background="images/RR.png"></td>
		</tr>
		<tr>
			<td height="11" width="6"><img border="0" src="images/DL.png" width="6" height="11"></td>
			<td height="0" width="672" background="images/DM.png"></td>
			<td height="11" width="6"><img border="0" src="images/DR.png" width="6" height="11"></td>
		</tr>
		</table><br><br><br>
		<font face="Arial" style="font-size: 6pt"> </font></td>
	</tr>
	</table>
	</td>
</tr>
</table>
<!------------------------------------------ 
EMPTY SPACE BELOW ALL TABLES AND ABOVE LINE
-------------------------------------------->
</div>
</td>
</tr>
<?php include("footer.php");
}

?>

Link to comment
Share on other sites

Ok,

 

What I would like to do is list all the songs by an artist exept the one that I'm listening to. EG,

 

I am listning to: Tinchy Stryder - You're Not Alone

 

So when I click "More From Tinchy" I would like it to show the other songs by that artist..

 

Currently it shows that song I'm listening too AND the rest of the songs, I would like to know how I eliminate the current song from the showing..

Link to comment
Share on other sites

Humm, its kinda hard to follow with so many queries however if you pass the id, logically it should work

 

<iframe width="237" height="270" src="userapplet.php?morelikethis=<?php echo "".$m['musicartist'].""; ?>" name="morelikethis" border="0" frameborder="0"></iframe></div></td>

become

<iframe width="237" height="270" src="userapplet.php?morelikethis=<?php echo $m['musicartist']."&mid=".$name; ?>" name="morelikethis" border="0" frameborder="0"></iframe></div></td>

 

$name2 = mysql_real_escape_string($_GET['morelikethis']);
   
$sql = sprintf("SELECT * FROM music WHERE musicartist LIKE '%s%%' AND musicartist !='%s' ORDER BY `musicartist` ASC LIMIT 0,6",$name2, $name2);
$s = mysql_query($sql) or die(mysql_error());

becomes

$name2 = mysql_real_escape_string($_GET['morelikethis']);
$mid = (int)$_GET['mid'];

$sql = sprintf("SELECT * FROM music WHERE musicartist LIKE '%s%%' AND musicid !=%d ORDER BY `musicartist` ASC LIMIT 0,6",$name2, $mid);
$s = mysql_query($sql) or die(mysql_error());

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.