Avatar of evibesmusic
Flag for United States of America

asked on 

How to check the value of the address bar and then return a specified file based on that value?

Hello Experts,

I have created a profile page system in which each user is outfitted with a music player that plays music from their unique directory.

When each user signs up, a directory is created using the 'username' that each new member has provided.  Thus creating one unique directory per user.  The location of each unique directory is stored in a db column called 'path'.

I would like to display the music player of the user whos page is being viewed.  For example: if I am on my profile page http://www.lionsshareworldmedia.com/test/members/BMan I would like to see only my music player that is located in my unique directory 'BMan'.

I have been able to create the code to show a music player but, I cannot figure out the php or sql syntax that allows for me to show only the player belonging to the profile page I am looking at.

I some code below to show you where I am at and would appreciate any input you may have to make this process work.

Thank You,

$data = mysql_query( "SELECT * FROM members" )
or die ("Could not run query: " . mysql_error () );
if (!$data) { 
 exit('<p>Error performing query: ' . mysql_error() . 
while ($getinfo = mysql_fetch_array($data)){
if (header = $location){ 
 echo 	'<iframe src="http://www.lionsshareworldmedia.com/test/members/'.$getinfo['username'].'/wimpy.php" width="480" height="140"></iframe>';

Open in new window


Avatar of undefined
Last Comment
Vel Eous

8/22/2022 - Mon