include "custom.php";
$shows_select=getShows();
?>
if ($_REQUEST['form_submitted']==1){
$errors = array();
if (!$_REQUEST['time']){
$errors[time] = "
Field is required";
} else {
$seconds=$_REQUEST['time']*60;
}
if (!$_REQUEST['name']){
$errors[name] = "
Field is required";
}
if ($_REQUEST['email']){
if(!preg_match("/[-.\\w]+\\@[-.\\w]+/", $_REQUEST[email])) {
$errors[email] = "
Invalid email address";
}
}if ($_REQUEST['public']=="yes"){
if($_REQUEST['show']=="") {
$errors[show] = "
You need to select a show";
}
}
if(sizeof($errors) > 0) {
$errors[error]="
Please fix the errors in the form
"; } else{ $filename = preg_replace("/[^\w\.]*/", "", $_REQUEST['name']); $filename = str_replace(" ", "", $filename); if($_REQUEST['bitrate']=="128"){ $cmd = 'bash -c "exec nohup /home/substep/.streamripper/bin/streamripper http://fleetfm.co.nz/FleetBroadband128.m3u -s -d /home/.odelyn/substep/audio.substep.com/fleetfm/ -l ' .$seconds. ' -a ' .$filename. ' --quiet > /dev/null 2>&1 &"' ; // echo $cmd ; exec($cmd) ; // exec('bash -c "exec nohup /home/substep/.streamripper/bin/streamripper http://fleetfm.co.nz/FleetBroadband128.m3u -s -d /home/.odelyn/substep/audio.substep.com/fleetfm/ -l ' .$seconds. ' -a ' .$filename. ' --quiet > /dev/null 2>&1 &"'); } elseif($_REQUEST['bitrate']=="64"){ exec('bash -c "exec nohup /home/substep/.streamripper/bin/streamripper http://fleetfm.co.nz/FleetBroadband.m3u -s -d /home/substep/audio.substep.com/fleetfm/ -l ' .$seconds. ' -a ' .$filename. ' --quiet > /dev/null 2>&1 &"'); } elseif($_REQUEST['bitrate']=="32"){ exec('bash -c "exec nohup /home/substep/.streamripper/bin/streamripper http://fleetfm.co.nz/FleetDialUp.m3u -s -d /home/substep/audio.substep.com/fleetfm/ -l ' .$seconds. ' -a ' .$filename. ' --quiet > /dev/null 2>&1 &"'); } $success="Your file can be found at http://audio.substep.com/fleetfm/".$filename.".mp3
"; if ($_REQUEST['public']=="yes"){ addShow($_REQUEST['show'], $filename.".mp3", $_REQUEST['description'], $_REQUEST['email'], $_REQUEST['time'], '1'); } else { addShow($_REQUEST['show'], $filename.".mp3", $_REQUEST['description'], $_REQUEST['email'], $_REQUEST['time'], '0'); } if ($_REQUEST['email']){ mail($_REQUEST['email'],"Link to your Fleet FM Show","The recording of your show can be found at http://audio.substep.com/fleetfm/".$filename.".mp3 or a link to it is ".$filename.".mp3 and it is ".$_REQUEST['time']." minutes long and recorded in ".$_REQUEST['bitrate']." Kbps.",'',''); } } } ?>