Hi everyone i have maked pop upp audio player play.php and i want to my url adress to appear like this www.mydomain.com/play.php?id=1 instead of www.mydomain.com/play.php?id=music.mp3 so here are what i have now

play.php code

<?php$mURL=$_REQUEST['id']; ?>  <object id="p67"height=64 width=360 border="0"classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"type="application/x-oleobject"pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"><param name="URL" value="http://www.mydomain.com/<?php echo $mURL; ?>"><param name="autostart" value="-1"><param name="rate" value="1"><param name="balance" value="0"><param name="currentPosition" value="0"><param name="defaultFrame" value><param name="playCount" value="1"><param name="currentMarker" value="0"><param name="invokeURLs" value="-1"><param name="baseURL" value><param name="volume" value="50"><param name="mute" value="0"><param name="uiMode" value="full"><param name="stretchToFit" value="0"><param name="windowlessVideo" value="0"><param name="enabled" value="-1"><param name="enableContextMenu" value="-1"><param name="fullScreen" value="0"><param name="SAMIStyle" value><param name="SAMILang" value><param name="SAMIFilename" value><param name="captioningID" value><param name="enableErrorDialogs" value="0"><param name="_cx" value="7117"><param name="_cy" value="1191"><embed type="application/x-mplayer2"pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"name="p12"width=434height=45src="http://http://www.mydomain.com/<?php echo $mURL; ?>">showcontrols="true"autostart="false"> </embed></object><?php
$mURL=$_REQUEST['id'];

?>


<object id="p67"
height=64 width=360 border="0"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject"
pluginspage="http://www.microsoft.com/Windows/MediaPlayer/">
<param name="URL" value="http://www.mydomain.com/play.php?id=<?php echo $mURL; ?> ">
<param name="autostart" value="-1">
<param name="rate" value="1">
<param name="balance" value="0">
<param name="currentPosition" value="0">
<param name="defaultFrame" value>
<param name="playCount" value="1">
<param name="currentMarker" value="0">
<param name="invokeURLs" value="-1">
<param name="baseURL" value>
<param name="volume" value="50">
<param name="mute" value="0">
<param name="uiMode" value="full">
<param name="stretchToFit" value="0">
<param name="windowlessVideo" value="0">
<param name="enabled" value="-1">
<param name="enableContextMenu" value="-1">
<param name="fullScreen" value="0">
<param name="SAMIStyle" value>
<param name="SAMILang" value>
<param name="SAMIFilename" value>
<param name="captioningID" value>
<param name="enableErrorDialogs" value="0">
<param name="_cx" value="7117">
<param name="_cy" value="1191">
<embed type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
name="p12"
width=434
height=45
src="http://http://www.mydomain.com/play.php?id=<?php echo $mURL; ?> ">
showcontrols="true"
autostart="false"> </embed>
</object>

i would like also to appear my link code play.php?id=1 instead of play.php?id=music.mp3
here is the link code

<A HREF="javascript:void(1)"onclick="window.open('http://www.mydomain.com/play.php?id=music.mp3','linkname','height=505, width=480, resizable=0, scrollbars=1')">Play</a><A HREF="javascript<b></b>:void(1)"onclick="window.open('http://www.mydomain.com/play.php?id=music.mp3','linkname','height=505, width=480, resizable=0, scrollbars=1')">Play</a>

can anyone help me please thanks

    your link.... id=music.mp3 is the name of file automatically. if you want the file to be called by primary id you need to assign it a primary id by which it will be looked up in the database and that row of data will contain the path to where to look for your music file.

    hint: don't use $REQUEST variable instead use $GET since you are retrieving data from the URL.

      yes how can i do it or can you help me a simple example like
      play.php code
      database code
      linke code

      thanks for your replay please help me

        <?php
        
        # Sturcture #
        ###############
        # pickmp3.php #
        ##############################
        # <a href="?id=1">mp3 #1</a> #
        ##############################
        # accessdb.php #
        ################
        # play.php #
        ############
        
        // I will put it all here
        if (isset($_GET['id'])) {
            $id = $_GET['id'];
        
        
        $link = mysql_pconnect('localhost','user','pass');
        // you need to CREATE DATABASE mp3s
        // and GRANT ALL PRIVILEGES ON mp3s.* TO 'user'@'localhost' IDENTIFIED BY 'pass';
        mysql_select_db('mp3s');
        // create table songs
        // CREATE TABLE songs (id int auto_increment, artist varchar(30), title varchar(30), filepath varchar(100), primary key (id));
        $query = "INSERT INTO songs (id,artist,title,filepath)
                  VALUES (1,'Kid Cudi','Alive','/music/kidcudi_alive.mp3')";
        $result = mysql_query($query);
        // now once you got the data get it from db
        $query = "SELECT * FROM songs WHERE id=".$id." LIMIT 1";
        $result = mysql_query($query);    
        
        }
        
        ?>
        
        <html>
            <body>
            <?php if (empty($id)) { ?>
                <p><a href="?id=1">Kid Cudi - Alive</a></p>
            <?php } else {
                // you can fetch data from database result set using mysql_fetch_assoc()
                    $row = mysql_fetch_assoc($result);
            ?>
            <table>
                <tr>
                    <td><h1>Song Selected: <?php echo $row['title'] ." by " . $row['artist']; ?></h1></td>
                </tr>
                <tr>
                    <td>
                    <!-- your movie player goes here -->
                    <?php echo $row['filepath']; ?>
                    </td>
                </tr>
            </table>
        
        <?php } ?>
        </body>
        </html>
        

          i will look this how to do pop upp link code
          thanks

            Hi i did this and all my mp3 file in a single directory to the server i created a database table in mysql here is what i did please help me
            accessdb.php

            <?php
            
            if (isset($_GET['id'])) {
                $id = $_GET['id'];
            
            
            $link = mysql_pconnect('localhost','peter','123456');
            
            mysql_select_db('audio');
            
            $query = "INSERT INTO mp3s (id,artist,title,filepath)
                      VALUES (1,'Kid Cudi','Alive','/path/kidcudi_alive.mp3')";
            $result = mysql_query($query);
            
            $query = "SELECT * FROM mp3s WHERE id=".$id." LIMIT 1";
            $result = mysql_query($query);   
            
            }
            
            ?>

            popup player.php

            <?php if (empty($id)) { ?>
            <?php } else {
            // you can fetch data from database result set using mysql_fetch_assoc()
                 $row = mysql_fetch_assoc($result);
            ?>
            
            <table>
            <tr>
            <td><h1><?php echo $row['title'] ." by " . $row['artist']; ?></h1></td>
            </tr>
            <tr>
            <td>
            <td valign="top"> <div align="center"> <embed src="mydomail.com/path/<?php echo $row['filepath']; ?>
            " type="audio/x-pn-realaudio-plugin" CONSOLE="Clip1"
            CONTROLS="ControlPanel,StatusBar" HEIGHT="57" WIDTH="400" AUTOSTART="true"></div>
            </td>
            </tr>
            </table><br>
            
            
            
            <?php } ?>

            link code

            <a href="/player.php?id=1">listen music</a>

              you need to create a table that stores the mp3s location name that looks like this..

              ==========================================
              |      id       |     name    |    path   |
              -----------------------------------------
              |      1        |  Song Name |  song.mp3 |
              -----------------------------------------
              |      2        |  Song Name |  song.mp3 |
              -----------------------------------------
              |      3        |  Song Name |  song.mp3 |
              ==========================================

              Obviously add more cols if you want more data stored.
              Then select the song by its ID rather than path name.
              You said you named the file accessdb.php.. are you using mssql or mysql?

                Hi i did the table and stored all information but not working how can i call the file in the link and what can i write in the play.php i mean pop up player thanks

                  Write a Reply...