PDA

View Full Version : Need Help** Urgent



dj30324
11-05-2008, 06:48 PM
hi people how are you all? ok this is the original script excutes like this

player.php?urls=<URL1.FLV>,<URL2.FLV>

<?php
//player.php
session_start();
$_SESSION["flv"]=explode(",",$_GET["urls"]);
if ((strstr($_GET["urls"],"divx"))||(strstr($_GET["urls"],".avi"))){
$_SESSION["divx"]=true;
echo("<html>
<head></head>
<body TOPMARGIN=\"0\" LEFTMARGIN=\"0\" MARGINWIDTH=\"0\" MARGINHEIGHT=\"0\" hspace=\"0\" vspace=\"0\">
<object classid=\"clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616\" codebase=\"http://go.divx.com/plugin/DivXBrowserPlugin.cab\" width=\"500\" height=\"400\">
<param name=\"custommode\" value=\"none\">
<param name=\"autoPlay\" value=\"true\">
<param name=\"src\" value=\"video.php/0&".session_name()."=".session_id()."\">
<embed type=\"video/divx\" src=\"video/0&".session_name()."=".session_id()."\" custommode=\"none\" autoplay=\"true\" pluginspage=\"http://go.divx.com/plugin/download/\" width=\"500\" height=\"400\">
</object>
</body>
</html>
");
}
else {
echo ("<html>
<head>
<title>flowplayer</title>
<script type=\"text/javascript\" src=\"flashembed.min.js\"></script>
<script>
flashembed(\"flowplayer\", {src:'FlowPlayerDark2.2.swf',width: 500, height: 400},
{config: {
menuItems: [true, true, true, true, true, false, false],
showMenu: false,
loop: false,
autoPlay: false,
autoBuffering: true,
initialScale: 'fit',
bufferBarColor1: '0x550000',
bufferBarColor2: '0xEE0000',
playList: [\n");
for ($i=0;$i<count($_SESSION["flv"]);$i++){
echo "\t\t\t\t{ url: 'video/$i' },\n";
};
echo("]}});
</script>
</head>
<body TOPMARGIN=\"0\" LEFTMARGIN=\"0\" MARGINWIDTH=\"0\" MARGINHEIGHT=\"0\" hspace=\"0\" vspace=\"0\">
<div id=\"flowplayer\"></div>
</body>
</html>");
};
?>
when the flv is executed in a playlist style in


/?urls=http%3A%2F%2Ff.youku.com%2Fplayer%2FgetFlvPath%2Fsid%2F00_00%2Fst%2Fflv%2Ffileid%2F020064070047304AC7BE9200482720475F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B%3FK%3D0dd9fa5b31ca21b214f9697%2Chttp%3A%2F%2Ff.youku.com%2Fplayer%2FgetFlvPath%2Fsid%2F00_00%2Fst%2Fflv%2Ffileid%2F020064070147304AC7BE920048272047 5F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B%3FK%3D0dd9fa5b31ca21b214f9697%2Chttp%3A%2F%2Ff.youku.com%2Fplayer%2FgetFlvPath%2Fsid%2F00_00%2Fst%2Fflv%2Ffileid%2F020064070247304AC7BE920048272047 5F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B%3FK%3D0dd9fa5b31ca21b214f9697%2Chttp%3A%2F%2Ff.youku.com%2Fplayer%2FgetFlvPath%2Fsid%2F00_00%2Fst%2Fflv%2Ffileid%2F020064070347304AC7BE920048272047 5F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B%3FK%3D0dd9fa5b31ca21b214f9697%2Chttp%3A%2F%2Ff.youku.com%2Fplayer%2FgetFlvPath%2Fsid%2F00_00%2Fst%2Fflv%2Ffileid%2F020064070447304AC7BE920048272047 5F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B%3FK%3D0dd9fa5b31ca21b214f9697%2Chttp%3A%2F%2Ff.youku.com%2Fplayer%2FgetFlvPath%2Fsid%2F00_00%2Fst%2Fflv%2Ffileid%2F020064070547304AC7BE920048272047 5F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B%3FK%3D0dd9fa5b31ca21b214f9697%2Chttp%3A%2F%2Ff.youku.com%2Fplayer%2FgetFlvPath%2Fsid%2F00_00%2Fst%2Fflv%2Ffileid%2F020064070647304AC7BE920048272047 5F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B%3FK%3D0dd9fa5b31ca21b214f9697&type=flv



//play it showes like this on view source
playList: [
{ url: 'video/0' },
{ url: 'video/1' },
{ url: 'video/2' },
{ url: 'video/3' },
{ url: 'video/4' },
{ url: 'video/5' },
{ url: 'video/6' },
]}});

playlist is like this shows above but i want to excute it rather then displaying this

{ url: 'video/0' },
after it executes i wanted to display the url
playList: [
{ url: 'http://f.youku.com/player/getFlvPath/sid/00_00/st/flv/fileid/020064070047304AC7BE9200482720475F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B?K=0dd9fa5b31ca21b214f9697 },
{ url: 'http://f.youku.com/player/getFlvPath/sid/00_00/st/flv/fileid/020064070047304AC7BE9200482720475F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B?K=0dd9fa5b31ca21b214f9697' },
{ url: 'http://f.youku.com/player/getFlvPath/sid/00_00/st/flv/fileid/020064070047304AC7BE9200482720475F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B?K=0dd9fa5b31ca21b214f9697' },
{ url: 'http://f.youku.com/player/getFlvPath/sid/00_00/st/flv/fileid/020064070047304AC7BE9200482720475F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B?K=0dd9fa5b31ca21b214f9697' },
{ url: 'http://f.youku.com/player/getFlvPath/sid/00_00/st/flv/fileid/020064070047304AC7BE9200482720475F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B?K=0dd9fa5b31ca21b214f9697' },
{ url: 'http://f.youku.com/player/getFlvPath/sid/00_00/st/flv/fileid/020064070047304AC7BE9200482720475F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B?K=0dd9fa5b31ca21b214f9697' },
{ url: 'http://f.youku.com/player/getFlvPath/sid/00_00/st/flv/fileid/020064070047304AC7BE9200482720475F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B?K=0dd9fa5b31ca21b214f9697' },
]}});
on the view source so it can play on all browser rather then only Firefox.
php source for that code that excutes is

playList: [\n");
for ($i=0;$i<count($_SESSION["flv"]);$i++){
echo "\t\t\t\t{ url: 'video/$i' },\n";
};
echo("]}});
i gave it a try

playList: [\n");
$i = $_GET["urls"];
for ($i=0;$i<count($_SESSION["flv"]);$i++){
echo "\t\t\t\t{ url: '$i' },\n";
};
echo("]}});
but i failed i get error like

Parse error: syntax error, unexpected T_FOR in /home/a1182391/public_html/nabber/player/index.php on line 42
next 1 i fix and the random playlist display does not show up

help me plz again this is not my code. i am new in php

Jesdisciple
11-06-2008, 02:30 AM
Umm... Would you mind telling us what this script accomplishes? Also, what are the contents of index.php?

dj30324
11-06-2008, 03:52 AM
plays the playlist flash player but you when the this code is executed
here like url

player.php?urls=http%3A%2F%2Ff.youku.com%2Fplayer%2FgetFlvPath%2Fsid%2F00_00%2Fst%2Fflv%2Ffileid%2F020064070047304AC7BE9200482720475F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B%3FK%3D0dd9fa5b31ca21b214f9697%2Chttp%3A%2F%2Ff.youku.com%2Fplayer%2FgetFlvPath%2Fsid%2F00_00%2Fst%2Fflv%2Ffileid%2F020064070147304AC7BE920048272047 5F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B%3FK%3D0dd9fa5b31ca21b214f9697%2Chttp%3A%2F%2Ff.youku.com%2Fplayer%2FgetFlvPath%2Fsid%2F00_00%2Fst%2Fflv%2Ffileid%2F020064070247304AC7BE920048272047 5F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B%3FK%3D0dd9fa5b31ca21b214f9697%2Chttp%3A%2F%2Ff.youku.com%2Fplayer%2FgetFlvPath%2Fsid%2F00_00%2Fst%2Fflv%2Ffileid%2F020064070347304AC7BE920048272047 5F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B%3FK%3D0dd9fa5b31ca21b214f9697%2Chttp%3A%2F%2Ff.youku.com%2Fplayer%2FgetFlvPath%2Fsid%2F00_00%2Fst%2Fflv%2Ffileid%2F020064070447304AC7BE920048272047 5F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B%3FK%3D0dd9fa5b31ca21b214f9697%2Chttp%3A%2F%2Ff.youku.com%2Fplayer%2FgetFlvPath%2Fsid%2F00_00%2Fst%2Fflv%2Ffileid%2F020064070547304AC7BE920048272047 5F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B%3FK%3D0dd9fa5b31ca21b214f9697%2Chttp%3A%2F%2Ff.youku.com%2Fplayer%2FgetFlvPath%2Fsid%2F00_00%2Fst%2Fflv%2Ffileid%2F020064070647304AC7BE920048272047 5F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B%3FK%3D0dd9fa5b31ca21b214f9697&type=flv
after the it is executed, in the view source it only shows this
below is the javscript for the player

playList: [
{ url: 'video/0' },
{ url: 'video/1' },
{ url: 'video/2' },
{ url: 'video/3' },
{ url: 'video/4' },
{ url: 'video/5' },
{ url: 'video/6' },
]}});
but this code only works with firefox browser, and doesnt work with any other so to make it work i want to change and start displaying the url rather then video/0 etc etc.
and i want to make it so when you want to view source the code it would look like this

playList: [
{ url: 'http://f.youku.com/player/getFlvPath/sid/00_00/st/flv/fileid/020064070047304AC7BE9200482720475F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B?K=0dd9fa5b31ca21b214f9697 },

]}});


so i need help to change the code look above for details. i hope every 1 understands and could help me modify this code to make it work thank you so much.

Jesdisciple
11-06-2008, 05:08 AM
Try this for loop instead of the current one.
for ($i=0;$i<count($_SESSION["flv"]);$i++){
echo "\t\t\t\t{ url: '{$_SESSION['flv'][$i]}' },\n";
};

dj30324
11-06-2008, 09:31 PM
thanks you so much for helping, i guess it was mistake on my part
but i if it was this address of

player.php?urls=http%3A%2F%2Ff.youku.com%2Fplayer%2FgetFlvPath%2Fsid%2F00_00%2Fst%2Fflv%2Ffileid%2F020064070047304AC7BE9200482720475F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B%3FK%3D0dd9fa5b31ca21b214f9697%2Chttp%3A%2F%2Ff.youku.com%2Fplayer%2FgetFlvPath%2Fsid%2F00_00%2Fst%2Fflv%2Ffileid%2F020064070147304AC7BE920048272047 5F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B%3FK%3D0dd9fa5b31ca21b214f9697%2Chttp%3A%2F%2Ff.youku.com%2Fplayer%2FgetFlvPath%2Fsid%2F00_00%2Fst%2Fflv%2Ffileid%2F020064070247304AC7BE920048272047 5F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B%3FK%3D0dd9fa5b31ca21b214f9697%2Chttp%3A%2F%2Ff.youku.com%2Fplayer%2FgetFlvPath%2Fsid%2F00_00%2Fst%2Fflv%2Ffileid%2F020064070347304AC7BE920048272047 5F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B%3FK%3D0dd9fa5b31ca21b214f9697%2Chttp%3A%2F%2Ff.youku.com%2Fplayer%2FgetFlvPath%2Fsid%2F00_00%2Fst%2Fflv%2Ffileid%2F020064070447304AC7BE920048272047 5F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B%3FK%3D0dd9fa5b31ca21b214f9697%2Chttp%3A%2F%2Ff.youku.com%2Fplayer%2FgetFlvPath%2Fsid%2F00_00%2Fst%2Fflv%2Ffileid%2F020064070547304AC7BE920048272047 5F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B%3FK%3D0dd9fa5b31ca21b214f9697%2Chttp%3A%2F%2Ff.youku.com%2Fplayer%2FgetFlvPath%2Fsid%2F00_00%2Fst%2Fflv%2Ffileid%2F020064070647304AC7BE920048272047 5F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B%3FK%3D0dd9fa5b31ca21b214f9697&type=flv
it should display this below on the view source i did try your script, it works for only 1, nt multiple , it how it should look for multiple urls calls on

playList: [
{ url: 'http://f.youku.com/player/getFlvPath/sid/00_00/st/flv/fileid/020064070047304AC7BE9200482720475F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B?K=0dd9fa5b31ca21b214f9697 },
{ url: 'http://f.youku.com/player/getFlvPath/sid/00_00/st/flv/fileid/020064070047304AC7BE9200482720475F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B?K=0dd9fa5b31ca21b214f9697' },
{ url: 'http://f.youku.com/player/getFlvPath/sid/00_00/st/flv/fileid/020064070047304AC7BE9200482720475F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B?K=0dd9fa5b31ca21b214f9697' },
{ url: 'http://f.youku.com/player/getFlvPath/sid/00_00/st/flv/fileid/020064070047304AC7BE9200482720475F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B?K=0dd9fa5b31ca21b214f9697' },
{ url: 'http://f.youku.com/player/getFlvPath/sid/00_00/st/flv/fileid/020064070047304AC7BE9200482720475F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B?K=0dd9fa5b31ca21b214f9697' },
{ url: 'http://f.youku.com/player/getFlvPath/sid/00_00/st/flv/fileid/020064070047304AC7BE9200482720475F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B?K=0dd9fa5b31ca21b214f9697' },
{ url: 'http://f.youku.com/player/getFlvPath/sid/00_00/st/flv/fileid/020064070047304AC7BE9200482720475F1254-A1C7-41D3-F7BC-5A9D0B9B6C4B?K=0dd9fa5b31ca21b214f9697' },
]}});
i did modify the port of the script and i tried this


for ($i=t+t+t+t;$i<count($_SESSION["flv"]);$i++){
echo "{ url: '{$_SESSION['flv'][$i]}' },\n";
};

it didnt work and if its a single flv url then it should play single, but if the url is multiple url then the script should play multiple . , thank you again , any help you can give will greatly be appriciated.!! thanks in advance

Jesdisciple
11-06-2008, 10:32 PM
$i=t+t+t+t;That will first look for the constant 't' and multiply it by 4. If the constant isn't defined (which it isn't, as far as I know), the string 't' will be multiplied by 4 instead. That doesn't make sense, and that's a reason that the script doesn't work. It should be this instead:
$i=0;

dj30324
11-07-2008, 01:00 AM
bro i did used your script it does work , but only plays single
this is your script

for ($i=0;$i<count($_SESSION["flv"]);$i++){
echo "\t\t\t\t{ url: '{$_SESSION['flv'][$i]}' },\n";
};

i would like the script to play multiple files when the multiple urls are called,display multiple url on the view source, as i explained above , could you help me , thanks you in advance . thanks again for taking time, .

Jesdisciple
11-07-2008, 02:23 AM
I ran the script on my home server and found all 7 URLs in the page's source.
<?php
//player.php
session_start();
$_SESSION["flv"]=explode(",",$_GET["urls"]);
if ((strstr($_GET["urls"],"divx"))||(strstr($_GET["urls"],".avi"))){
$_SESSION["divx"]=true;
echo("<html>
<head></head>
<body TOPMARGIN=\"0\" LEFTMARGIN=\"0\" MARGINWIDTH=\"0\" MARGINHEIGHT=\"0\" hspace=\"0\" vspace=\"0\">
<object classid=\"clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616\" codebase=\"http://go.divx.com/plugin/DivXBrowserPlugin.cab\" width=\"500\" height=\"400\">
<param name=\"custommode\" value=\"none\">
<param name=\"autoPlay\" value=\"true\">
<param name=\"src\" value=\"video.php/0&".session_name()."=".session_id()."\">
<embed type=\"video/divx\" src=\"video/0&".session_name()."=".session_id()."\" custommode=\"none\" autoplay=\"true\" pluginspage=\"http://go.divx.com/plugin/download/\" width=\"500\" height=\"400\">
</object>
</body>
</html>
");
}
else {
echo ("<html>
<head>
<title>flowplayer</title>
<script type=\"text/javascript\" src=\"flashembed.min.js\"></script>
<script>
flashembed(\"flowplayer\", {src:'FlowPlayerDark2.2.swf',width: 500, height: 400},
{config: {
menuItems: [true, true, true, true, true, false, false],
showMenu: false,
loop: false,
autoPlay: false,
autoBuffering: true,
initialScale: 'fit',
bufferBarColor1: '0x550000',
bufferBarColor2: '0xEE0000',
playList: [\n");
for ($i=0;$i<count($_SESSION["flv"]);$i++){
echo "\t\t\t\t{ url: '{$_SESSION['flv'][$i]}' },\n";
};
echo("]}});
</script>
</head>
<body TOPMARGIN=\"0\" LEFTMARGIN=\"0\" MARGINWIDTH=\"0\" MARGINHEIGHT=\"0\" hspace=\"0\" vspace=\"0\">
<div id=\"flowplayer\"></div>
</body>
</html>");
};
?>

dj30324
11-07-2008, 08:19 AM
yea bro it works fine thanks again, works fine on other server freehostia other free php site except for this stupid site http://www.000webhost.com/91000.html this site is stupid any way,

Chris Bro thanks you so much for your help, thank you ! very much for your time . thats the end