Jump to content

[SOLVED] Make members listen to other members profile music


Recommended Posts

I added a feature in the profile where they can add a link to a music file and it will play it in their profile.

 

The only problem is that, when someone visits someone else profile, it plays their own song instead of the other members song.

I know this is because I didn't add a script so it can play the other members song.

 

So far, I only have this PHP script when someone views a profile:

<embed src="<?PHP
echo "$music";
?>" width=0 height=0 play=true loop=true quality=high>
</embed>

 

I don't know the script that will allow to play only the members profile song and not their own.

Sorry,

 

The $music is the link to the music file (.mp3) that the member chooses.

 

I am really new to this and very sorry if I don't provide enough information regarding my question. If you need more information in order to help me out, please let me know.

Your looking in the wrong spot.

 

What really matters is how you pulled $music out of the database. It seems as though it is carried along with the viewing user and used that way instead of it being assigned to the current profile that is being viewed.

 

Find where the data is being pulled out and store the user's profile who is being viewed music information in $music and it should work.

If I understood correctly, it was only playing the members music because the script only said to play his one and not the profile's one.

 

After checking the script, I've realized that I had the fetch $music script on top of the $viewprofile.

 

So, I tried changing it around a few times for a few hours but never got anything. It's not even playing any music now.

 

Does this look good?

	<? 	$lijstGebruikers = "SELECT * FROM users WHERE username='$viewprofile'";
		$resultLijstGebruikers = mysql_query($lijstGebruikers);
		while ($row = mysql_fetch_array($resultLijstGebruikers)) {


 ?>

<html>
<head>
    <div class="window">
<div class="mainTitle">View Profile</div>
<div class="mainText">
	<table border=1 width=95%><tr><td background="images/bgMainTitle.jpg"><center><b><? echo $username2 ?>'s Profile</b></center></td></tr></table>
	<table border=1 width=95%>
</head>
<embed src="<?php echo "$fetch->music"; ?>" width=0 height=0 play=true loop=true quality=high>
</embed>
<body>
	<tr><td width="90"><b>Name:</b></td><td><? echo "<a class=\"menuItem\" href=\"inbox.php?naampie=$username2\"> $username2</a>"; ?> 
<?
			 if ($row[moderator] == 0) {
			 		echo " ";
			 $i++;
			} else {
			 if ($row[moderator] == 3) {
					echo "<font color=yellow>(Programmer)</font>";
			$i++;
			} else {
			 if ($row[moderator] == 2) {
					echo "<font color=red>(Admin)</font>";
			 $i++;

			} else {
			if ($row[moderator] == 1) {
			 		echo "<font color=green>(Helpdesk)</font>";
			$i++;

		}
		}
		}
		}
	}
		?>

<? 	$lijstGebruikers = "SELECT * FROM users WHERE username='$viewprofile'";
$resultLijstGebruikers = mysql_query($lijstGebruikers);
while ($row = mysql_fetch_array($resultLijstGebruikers)) {


?>

 

Were did you get the $row? Unless its diclared somewere else, the script is wrong....

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.