Jump to content

[SOLVED] PLZ HELP , I M new to php


sushantkaura

Recommended Posts

hey guys ,

i m new to php , so having a little trouble,

plz help me out

i m using a player to play songs whose statement is written in JAVA SCRIPT which is in my player.php

 

<script type="text/javascript">

  var so = new SWFObject("playerSingle.swf", "mymovie", "192", "67", "7", "#FFFFFF");

  so.addVariable("autoPlay", "yes");

  *so.addVariable("soundPath", "song.mp3");

  so.write("flashPlayer");

</script>

 

i want to place a different url which is in my variable $url,in php rather than song.mp3

plz tell me how to do it... 

thnx in advance.....................

sushant kaura

 

Link to comment
Share on other sites

hey guys ,

i m new to php , so having a little trouble,

please help me out

i m using a player to play songs whose statement is written in JAVA SCRIPT which is in my player.php

 

<script type="text/javascript">

   var so = new SWFObject("playerSingle.swf", "mymovie", "192", "67", "7", "#FFFFFF");

   so.addVariable("autoPlay", "yes");

   *so.addVariable("soundPath", "song.mp3");

   so.write("flashPlayer");

</script>

 

i want to place a different url which is in my variable $url,in php rather than song.mp3

please tell me how to do it... 

thnx in advance.....................

sushant kaura

 

 

<script type="text/javascript">
   var so = new SWFObject("playerSingle.swf", "mymovie", "192", "67", "7", "#FFFFFF");
   so.addVariable("autoPlay", "yes");
   *so.addVariable("soundPath", "<?=$url?>");
   so.write("flashPlayer");
</script>

Link to comment
Share on other sites

whats the webpages url?

heres an example.

 

<?php
$url = "test.mp3";
?>
<script type="text/javascript">
   var so = new SWFObject("playerSingle.swf", "mymovie", "192", "67", "7", "#FFFFFF");
   so.addVariable("autoPlay", "yes");
   so.addVariable("soundPath", "<?=$url?>");
   so.write("flashPlayer");
</script>

Link to comment
Share on other sites

actually the the songs are on my computer , in $url i have given the path of the song, which path i have stored in my database and i have echoed it and its giving the rite path .

if i m giving space between <? and = , its not loading the player and if i dont leave a space

than it show the previous error

Link to comment
Share on other sites

here is the code , shold i send u the java script and the player.swf

in this code the session is used for the url from the earlier page.

song.mp3 is stored in the same dir.

 

<?php

session_start();

?>

<html >

<head>

<title>Player</title>

</head>

<body>

 

 

<?php

 

//echo "url is".$_SESSION['url'];

//$url=$_SESSION['url'];

$url="song.mp3";

 

?>

 

 

<script type="text/javascript" src="swfobject.js"></script>

 

<div id="flashPlayer">

  This text will be replaced by the flash music player.

</div>

 

<script type="text/javascript">

  var so = new SWFObject("playerSingle.swf", "mymovie", "192", "67", "7", "#FFFFFF");

  so.addVariable("autoPlay", "yes");

  so.addVariable("soundPath", "<?=$url?>");

  so.write("flashPlayer");

</script>

<p>

 

 

</p>

</body>

</html>

Link to comment
Share on other sites

if i m doin <?php $url ?>

thn its loading my player but not playing the song

and above tht i have set $url="song.mp3";

but its not playing .

but whn i only put simple song.mp3 in tht place its simply palying it .....

do u have any idea ..

i have downloaded tht player from net ..

its playing fine if i m giving any path but whni give php url , its not playing ...

can u help me out on this..

Link to comment
Share on other sites

you dont wanna do <?php $url ?>

 

<?php
session_start();
?>
<html >
<head>
<title>Player</title>
</head>
<body>


<?php 

//echo "url is".$_SESSION['url'];
//$url=$_SESSION['url'];
$url="song.mp3";

?>


<script type="text/javascript" src="swfobject.js"></script>
      
<div id="flashPlayer">
  This text will be replaced by the flash music player.
</div>

<script type="text/javascript">
   var so = new SWFObject("playerSingle.swf", "mymovie", "192", "67", "7", "#FFFFFF");
   so.addVariable("autoPlay", "yes");
   so.addVariable("soundPath", "<?=$url?>");
   so.write("flashPlayer");
</script>
<p>


</p>
</body>
</html>

 

Make sure that song.mp3 and  playerSingle.swf is in the same folder as this webpage for this to work

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.