Hi everyone i have maked pop upp audio player play.php and the i want to my url adress to appear like this

http://www.mydomain.com/play.php?id=1

now it appears this

http://www.mydomain.com/music.mp3

and here the pop upp player
Ex. play.php

<?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=434
height=45
src="http://http://www.mydomain.com/<?php echo $mURL; ?>">
showcontrols="true"
autostart="false"> </embed>
</object>

here is the link

<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>

can someone help the right code thanks

Recommended Answers

First check it directly whether your music is working or not thru browser

http://www.mydomain.com/music1.mp3

If above link play your music then no problem in your path

Jump to Post

I don't know what else I can do to help you. Validate your code to make sure the HTML is correct. If that doesn't work you'll have to keep researching it.

Whenever I have trouble with something like this I start by validating my HTML, then if that doesn't …

Jump to Post

Mr. bashaash ,

Finally I want to do onething, please attach your php files, give your table structure and records (in the sense, create table and insert into) just I need to paste in my phpmyadmin and it should created the table and inserted the records (U understand?),no need …

Jump to Post

Let I will check it and get you back now

Jump to Post

HTML file:

<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<body>
<A HREF="#"onclick="window.open('play.php?id=1','linkname','height=300, width=414, resizable=0, scrollbars=0')"><b>listen music</b></a>
</body>
</html>

Play.php:

<?php  

  $connection = mysql_connect('localhost','root',''); 
  if (!$connection) …
Jump to Post

All 50 Replies

Given the link you show, you are passing the string music.mp3 in the query string as the value of 'id'.

At lines 12 and 42 you have http://www.mydomain.com/<?php echo $mURL; ?> , so what you are going to get is http://www.mydomain.com/music.mp3 .

I think you have two problems.

First, you mean to pass it a song number, but instead you are passing the string music.mp3 .

Second, at lines 12 and 42, I think you want to put http://http://www.mydomain.com/[B]play.php?id=[/B]<?php echo $mURL; ?> instead of http://www.mydomain.com/<?php echo $mURL; ?> .

I hope that helps a bit.

Member Avatar

You passing value of id is music.mp3 then how come it display 1 for you? if you want 1 pass 1 instead of music.mp3

Member Avatar
<?php
$mURL=$_REQUEST['id'];
if ($mURL=="music.mp3") $mURL=1;
?>

The above code converts to 1 but no logic is here.

<?php
$mURL=$_REQUEST['id'];
if ($mURL=="music.mp3") $mURL=1;
?>

The above code converts to 1 but no logic is here.

yes the url adress bar always show this www.mydomain.com/play.php?id=music.mp3
if you help me another php pop upp audio player please send me to email the play.php code and the link code i think you understand me i want only my url adress appear like this play.php?id=1 not play.php?id=music.mp3 and thanks mr rajarajan
please help

bashaash70@hotmail.com

Member Avatar

Write your code as below:

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

<?php
$mURL=$_REQUEST;
if ($mURL==1) $mURL="music.mp3";
?>

not working if i change the link echo code it brokes i think there is some code needs all mp3 file to do it like each mp3 have an id like this
1=1music.mp3
2=2music.mp3
3=3music.mp3

thanks

Member Avatar

What is exact url displaying now?

What is exact url displaying now?

the link will be like this ('linkname','height=300, width=414, resizable=0, scrollbars=0')">play</a> it is broken if i chane play media.php?id=<?php echo
the url still shows music.mp3

What is exact url displaying now?

the url shows now play.php?=1 that what i wanna to see but not playing or detect the mp3 file and the link working this

<A HREF="javascript:void(1)"onclick="window.open('play.php?id=<?php echo "1"; ?>','linkname','height=300, width=414, resizable=0, scrollbars=0')">play</a>

the id is the red 1 but try to detect the mp3 file please
thanks

Member Avatar

I am asking what exactly displayed in your address bar

play.php?id=1 but not playing the mp3 file

Member Avatar
<?php
$mURL=$_REQUEST['id'];
if ($mURL==1) $mURL="music.mp3";
?>

did you implemented this?

<?php
$mURL=$_REQUEST['id'];
if ($mURL==1) $mURL="music.mp3";
?>

did you implemented this?

yes i did still no change i think all musics files have an id like
music1.mp3=1
music2.mp3=2
music3.mp3=3

Hey,
Let me guess that the music files you want to play is in the format
1.music1.mp3
2.music2.mp3
3.music3.mp3 .......etc
And the id you are passing will be 1,2,3,4........etc
If so implement Raja's Code with a small modification as below

<?php
      $mURL=$_REQUEST['id'];
      $mURL="music".$mURL.".mp3";
      ?>

Hey,
Let me guess that the music files you want to play is in the format
1.music1.mp3
2.music2.mp3
3.music3.mp3 .......etc
And the id you are passing will be 1,2,3,4........etc
If so implement Raja's Code with a small modification as below

<?php
      $mURL=$_REQUEST['id'];
      $mURL="music".$mURL.".mp3";
      ?>

Hi Manuz i did what you say but no changes ex i have 3 mp3 files and i want the url adress will be play.php?id=1 instead of play.php?id=music.mp3 how can i make
thanks you and Raja

Hey,
Tell me the exact name of the mp3 file that you have. You told "..have 3 mp3 files..".
List their exact name.

i have example
music1.mp3
music2.mp3
music3.mp3

i wnat each mp3 have an id like
play.php?id=1 for music1.mp3
play.php?id=2 for music2.mp3
play.php?id=3 for music3.mp3

thanks

Member Avatar

Then it will work know

<?php
      $mURL=$_REQUEST['id'];
      $mURL="music".$mURL.".mp3";
      ?>
Member Avatar

If you again facing the problem attach your files here to have a look

Member Avatar

Never mind did you give like this?

src="http://http://www.mydomain.com/<?php echo $mURL; ?>">

link code

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

play.php

<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=434
height=45
src="http://http://www.mydomain.com/<?php echo $mURL; ?>">
showcontrols="true"
autostart="false"> </embed>
</object>

my sound is
music1.mp3
music2.mp3

Member Avatar

First check it directly whether your music is working or not thru browser

http://www.mydomain.com/music1.mp3

If above link play your music then no problem in your path

yes if the url appears like this my music playing fine but i want my url not display file path and i want to be php?id=1 or 2 or 3 for mp3 files id
how can i make the files an id first

Member Avatar

In your play.php check the line 36

src="http://http://www.mydomain.com/<?php echo $mURL; ?>"> http:// typed twice. May be that was an error.

i chacked it is ok now but how to detect the mp3 id if we are not write the id or the example the link play.php?id=1 and my music have music1.mp3 how to detect the id if we not did i think we want to make the files to do an id each please can create the code for mp3 id
thanks

Member Avatar
<?php
      $mURL=$_REQUEST['id'];
      $mURL="music".$mURL.".mp3";
      ?>

This will subtitute as http://mydomain.com/music1.mp3. then what is the real problem, making confustions? and this will not going to be shown in your url

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.