0

The following code generates a new php file playlist.php which contains the code as in $start $result variable

$path = "./files/";
$path2="http://".$_SERVER['SERVER_NAME'].dirname($_SERVER["PHP_SELF"])."/files/";
//echo $path2;
$folder = opendir($path);
$start="<asx version='3.0'>\n<title>Example ASX playlist</title>";
$Fnm = "./playlist.php";
$inF = fopen($Fnm,"w");
fwrite($inF,$start."\n");
while( $file = readdir($folder) ) {
 if (($file != '.')&&($file != '..')&&($file != 'index.htm')){
 $result="<entry>\n<title>$file</title>\n<ref href='$path2$file'/>\n<param name='image'     value='preview.jpg'/>\n</entry>\n";
     fwrite($inF,$result);
 }
}
fwrite($inF,"</asx>");
closedir($folder);
fclose($inF);

I want to generate the same code in the same file which contains this code on a specified line number is this possible ?

The above php script generates the following code on a new file

 <asx version='3.0'>
        <title>Example ASX playlist</title>
        <entry>
        <title>sintel_trailer1.mp4</title>
        <ref href='/files/sintel_trailer1.mp4'/>
        <param name='image' value='preview.jpg'/>
        </entry>
        </asx>

Edited by ska_defender

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by ska_defender
0

I want to generate the same code in the same file which contains this code on a specified line number is this possible ?

Huh?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.