<?php

$data = "This is the string you want to save.";
$filename = "output.txt";

// Saves the file to the current directory
file_put_contents($filename, $data);

    $postData = $_POST; 
    $logEntry = print_r($postData, true) . "\n-------------------\n";
    file_put_contents('log.txt', $logEntry);

$streamid = $_POST['mount']; 

if ($streamid){ 
 
    $filename = '/var/www/kroobot.net/liquidsoap/rtmps.txt';
    $fileContent = file_get_contents($filename);
    $data = unserialize($fileContent);
    $data[$streamid] = 0;
    $updatedContent = serialize($data);
    file_put_contents($filename, $updatedContent);  
    
    header("icecast-auth-user: 1");
    
    }
    
    
    ?> 