Fsoft Posted December 26, 2008 Share Posted December 26, 2008 Hey Friends, how you doing? Well hope nice, I am working on a project for a friend's website , but I am stuck at a partiuclar point, The project is a script where people will enter a channel name and they will get access to it.. Now for better understanding ; stream/?watch=asia_net This is the first command which will tell script that this user wants to view channel called ASIA NET. The source original code of ASIA NET (the MMS LINK) is already saved in the script , in a variable, and then in the script the link of Asia net (MMS LINK) is encrypted several times!!! and then it will give a link like this in the embed of Media Player ; <embed="?watchnow=the encrypted form of link to channel&Securty=SESSION ID"> so in this, media player will look for the global variable ?wathnow And using if STATEMENT , when media player will get into it, the encrypted form of the link to channel will be decrypted into the original shape and will give a valid MMS shape like it was in starring, the link will be some thing like this ; mms://ip address/channel name EVERY thing is working as plan, but problem is now this link I have to pass through a function which will open this link in the MEDIA player, before I tried this with saving the link into an .asx file and save it in the same directory and simply include the file using simple include(); and it worked, but the problem is .asx file , is not secure enoguh, people can still get the MMS link of channel, What I want is that when I get MMS link in original shape, I want it to play the channel in the media player! Hope I made my self clear, Well please help and if some thing is not clear you can tell , I will post the source code for better understanding.. THANKs, looking forward for the answer, FAISAL! Quote Link to comment https://forums.phpfreaks.com/topic/138470-mms-file-reading/ Share on other sites More sharing options...
Adam Posted December 26, 2008 Share Posted December 26, 2008 You can actually setup PHP to parse any files.. Which would mean you can still have PHP functionality in your .asx files. Then to stop users viewing the content of the asx file through their browser, setup a global variable within your normal / 'parent' script that would include the asx file, such as: define('included', true); Then test for this in your asx file. Obviously it will work when the parents script includes it, but hide the content or whatever when the user tries to view it through their browser. The only problem I could think of would be if media player used this file, but if not, why the need for it to be a .asx file extension? There would probs be a work around for media player though.. A Quote Link to comment https://forums.phpfreaks.com/topic/138470-mms-file-reading/#findComment-723972 Share on other sites More sharing options...
Fsoft Posted December 26, 2008 Author Share Posted December 26, 2008 Well, Thanks, infact what I want is that people view the channel using our script the stream link(s) "the MMS link" is already saved in file, but if they take the source code or using property of their Media Player, they should not find a link to original stream as this is how people steal the channels and distribute and many sites.... And of-course then it effects on the performance of channels (speed as well).. SO what i wanted was that using my script , their media player will get a link to source fine . The link will be two parts, first part will be the MMS// stream link encoded and the second part, it wll be published with a token number (SESSION ID).. and each time session id will be reset, so it means if some one tries to steal or distribute the link to any other site, they will not work after a particular limit of time So for this ,,, I need a script, I made some thing, I am attaching the source code of file I made , <?php Session_Start(); //MD channels security system , written by FTS ! //2009 Malludreams Staff, All Rights reserved.. // 15:34 26 December 2008 (+1) French Standard time! $asia_net = "mms://64.46.45.140/asnet@malludreams.com"; //Edit the link in the double quotes! $asia_netplus = "mms://64.46.45.140/asiaplus@malludreams.com"; //Edit the link in the double quotes! $amirita = "mms://64.46.45.140/amirita@malludreams.com"; //Edit the link in the double quotes! $sid = Session_Id(); $form = "<body bgcolor=\"#3399FF\"> <p align=\"center\">\ <a href=\"../forum\"\> <img border=\"0\" src=\"http://i33.tinypic.com/ne9fdl.jpg\" width=\"950\" height=\"185\"></a></p> <p align=\"center\"> <embed src=\"$source_link\" type=\"application/x-mplayer2\" pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer/\" id=\"wmplayer\" bgcolor=\"#000000\" allowfullscreen=\"true\" autostart=\"1\" showstatusbar=\"1\" autosize=\"-1\" allowscan=\"-1\" allowchangedisplaysize=\"-1\" displaymode=\"0\" displaysize=\"4\" enabled=\"-1\" enablecontextmenu=\"0\" enablepositioncontrols=\"-1\" enablefullscreencontrols=\"1\" enabletracker=\"-1\" sendopenstatechangeevents=\"-1\" sendwarningevents=\"-1\" senderrorevents=\"-1\" sendkeyboardevents=\"0\" sendmouseclickevents=\"0\" sendmousemoveevents=\"0\" sendplaystatechangeevents=\"-1\" showcontrols=\"1\" showaudiocontrols=\"1\" showdisplay=\"0\" showgotobar=\"0\" showpositioncontrols=\"0\" showtracker=\"0\" volume=\"0\" height=\"399\" width=\"415\"><noembed>Use internet explorer to watch, come on , it's free with Windows!!!!</noembed></embed> </p> <p align=\"center\"><u><b><font size=\"5\" face=\"Comic Sans MS\">Sorry</font><font size=\"5\" face=\"Comic Sans MS\">, we don't allow stealing of code! If you want, come and contact our staff, we can think !</font></b></u></p> <p align=\"center\"><b><font face=\"Comic Sans MS\" size=\"5\" color=\"#FF0000\">You are viewing this page by $_SERVER[REMOTE_ADDR]</font></b></p> <p align=\"right\"><b><font face=\"Times New Roman\" size=\"2\">©2009 <a href=\"../forum\"><span style=\"text-decoration: none\">Malludreams staff </span> </a>All Rights Reserved!</font></b></p> <p align=\"center\"><i><font face=\"Consolas\"><b>Script written by Faisal TASLEEM SHAH! [MD STAFF]</b></font></i></p>"; function encode($string) { $en1 = base64_encode("$string"); $en2 = base64_encode("$en1"); return $en2; } function decode($string) { $de1 = base64_decode("$string"); $de2 = base64_decode("$de1"); return $de2; } if($_GET["showmenow"] !== "" && $_GET["SECURITY_KEY"] == $sid) { $showmenow = decode(strip_tags("$_GET[showmenow]")); exit(); } if($_GET["watch"] == "asia_net") { $source_link = encode("$asia_net"); //echo "<meta http-equiv=\"REFRESH\" content=\"0;URL=?showmenow=$source_link&SECURITY_KEY=$sid\">"; echo "<body bgcolor=\"#3399FF\"> <p align=\"center\">\ <a href=\"../forum\"\> <img border=\"0\" src=\"http://i33.tinypic.com/ne9fdl.jpg\" width=\"950\" height=\"185\"></a></p> <p align=\"center\"> <embed src=\"?showmenow=$source_link&SECURITY_KEY=$sid\" type=\"application/x-mplayer2\" pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer/\" id=\"wmplayer\" bgcolor=\"#000000\" allowfullscreen=\"true\" autostart=\"1\" showstatusbar=\"1\" autosize=\"-1\" allowscan=\"-1\" allowchangedisplaysize=\"-1\" displaymode=\"0\" displaysize=\"4\" enabled=\"-1\" enablecontextmenu=\"0\" enablepositioncontrols=\"-1\" enablefullscreencontrols=\"1\" enabletracker=\"-1\" sendopenstatechangeevents=\"-1\" sendwarningevents=\"-1\" senderrorevents=\"-1\" sendkeyboardevents=\"0\" sendmouseclickevents=\"0\" sendmousemoveevents=\"0\" sendplaystatechangeevents=\"-1\" showcontrols=\"1\" showaudiocontrols=\"1\" showdisplay=\"0\" showgotobar=\"0\" showpositioncontrols=\"0\" showtracker=\"0\" volume=\"0\" height=\"399\" width=\"415\"><noembed>Use internet explorer to watch, come on , it's free with Windows!!!!</noembed></embed> </p> <p align=\"center\"><u><b><font size=\"5\" face=\"Comic Sans MS\">Sorry</font><font size=\"5\" face=\"Comic Sans MS\">, we don't allow stealing of code! If you want, come and contact our staff, we can think !</font></b></u></p> <p align=\"center\"><b><font face=\"Comic Sans MS\" size=\"5\" color=\"#FF0000\">You are viewing this page by $_SERVER[REMOTE_ADDR]</font></b></p> <p align=\"right\"><b><font face=\"Times New Roman\" size=\"2\">©2009 <a href=\"../forum\"><span style=\"text-decoration: none\">Malludreams staff </span> </a>All Rights Reserved!</font></b></p> <p align=\"center\"><i><font face=\"Consolas\"><b>Script written by Faisal TASLEEM SHAH! [MD STAFF]</b></font></i></p>"; } elseif($_GET["watch"] == "asia_netplus") { } elseif($_GET["watch"] == "amirita") { }else { echo "<p align=\"center\"><b><font color=\"RED\">Sorry, but there is no channel selected to watch, please go to <a href=\"http://malludreams.com/forum\">Malludreams community forums</a> to select a valid channel link to watch ! <br>If you are trying to steal the link, Sorry but not possible </font></b></p>"; } ?> Everythign seems to work cool, but the problem is, in Media player embed code, I have some thing like this src=\"?showmenow=$source_link&SECURITY_KEY=$sid\" Which means that Media player will again go through the script and will get into $_GET["showmenow"]... AND inside of that script the encypted form of code gets back to the original form (MMS://) form, but now, how can I load the MMS:// URL data to Media Player? Well, As I said earlier , I am doing this all because just because to hide the original link from User(s) so that they can't steal it and post to other sites.. Thanks, any help will be appriciated, and well, if there is any other better way using php you think can solve this problem, all the suggestions are welcome Thanks once again, FAISAL! Quote Link to comment https://forums.phpfreaks.com/topic/138470-mms-file-reading/#findComment-724011 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.