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
https://forums.phpfreaks.com/topic/76890-solved-plz-help-i-m-new-to-php/
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>

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>

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

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>

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.