3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php require_once("assets/config.php"); require_once("assets/sys2.php"); ini_set('memory_limit', '-1'); if(!$keyword){ $head=' <link rel="canonical" href="http://sc-downloader.com/search" /> '; } else { $head=' <link rel="canonical" href="http://sc-downloader.com/search/'.$keyword2.'" /> '; } if($keyword){ $pagetitle=$keyword." | Sound Tracks | ".$sitename." Search"; $description="Download ".$keyword." tracks, ".$keyword." music files. See all results for ".$keyword.". Download ".$keyword." from SoundCloud now and enjoy your favorite music!"; $metakeywords=$keyword.", ".$keyword." music tracks, ".$keyword." search audio, ".$keyword." search engine, ".$metakeywords; } else { $pagetitle="Search Tracks | SoundCloud Search Engine | ".$sitename; $description="Search and download your favorite SoundCloud tracks. SoundCloud Search Engine can let you enjoy your favorite music. Search your song and download it from SoundCloud now. Fast and simple SoundCloud downloader"; $metakeywords="search mp3, soundcloud search, soundcloud search engine, search audio, mp3 search engine, audio files, search soundcloud, download soundcloud"; } if( empty( $obj ) ) { if($_SESSION['e']){ header("Location: /search?msg=No result found!"); exit(); } else { header("Location: /search/".$keyword."?action=viewmore"); $_SESSION['e']=1; exit(); } } require_once("assets/header.php"); ?> <h2 style="display:block;text-align:center;">SoundCloud Search Engine</h2> <form style="display:block;text-align:center;" id="searchform" action="/search.php" method="GET"> <input type="hidden" name="r" value="1" /> <input type="text" value="<?=$keyword?>" placeholder="Enter a song name or artist..." class="input" id="q" name="q" /> <input style="top: -1px;position: relative;left: -4px;padding-top: 6px;" type="submit" class="btn" value="Search" /> </form> <?php if($keyword){ ?> <script type="text/javascript" src="/assets/audio-player.js"></script> <?php foreach($obj as $arr){ if($i){ $i++; } else { $i=1; } $track_id=$arr['id']; $title=$arr['title']; $uri=$arr['uri'].".json"; $uri = modify_url(array('client_id' => '6813c5d125013568ef986b73e4ba265c'), $uri); $json = file_get_contents($uri); $obj = json_decode($json, true); $sclink=$obj['permalink_url']; $streamable=$obj['streamable']; $downloadable=$obj['downloadable']; $download=$obj['download_url']; $stream=$obj['stream_url']; $pic=$obj['artwork_url']; $user=$obj['user']; $user_id=$user['id']; $user=$user['username']; if($streamable==false){ if($downloadable==true){ $stream=$download; } } if($streamable==false && $downloadable==false){ break; } $queryu = parse_url($stream, PHP_URL_QUERY); // Returns a string if the URL has parameters or NULL if not if( $queryu ) { $stream .= '&client_id='.$client_id; } else { $stream .= '?client_id='.$client_id; } $headers2=get_headers($stream,1); $location2=$headers2['Location']; if(!$location2){ $location2="/download.php?url=".$track_url; } $duration=$arr['duration']; if(!$pic){ $pic='http://dummyimage.com/100x100/000000/ffffff&amp;text=No+PIC'; } ?> <h2 style="margin-bottom: 10px;">Download <?=$title?> (uploaded by <?=$user?>)</h2> <div id="dl" style="padding-bottom: 10px;border-bottom:1px solid #ccc;"> <img class="artwork" src="<?=$pic?>" alt="<?=$title?>" /> <div class="dl2"> <span class="h3">Title:</span> &nbsp; <?=$title?><br/> <span class="h3">Duration:</span> &nbsp; <?=duration($duration)?> <object style="position:relatvie;top:2px;display:block;" type="application/x-shockwave-flash" data="http://sc-downloader.com/assets/player.swf" id="audioplayer<?=$i?>" height="24" width="290"> <param name="movie" value="http://sc-downloader.com/assets/player.swf"> <param name="FlashVars" value="playerID=audioplayer<?=$i?>&amp;soundFile=<?=urlencode($location2)?>&amp;text=0xdddddd"> <param name="quality" value="high"> <param name="menu" value="false"> <param name="wmode" value="transparent"> </object> <br/> <a class="btn" href="/download.php?url=<?=$sclink?>">Download</a> </div> <a href="<?=$sclink?>" target="_blank" rel="nofollow" style="clear:both;float:right;text-decoration:underline;">View on SoundCloud</a> </div> <?php } if($i<10){ fetchmore($nexturl); } function fetchmore($url){ $url=$nexturl; $json = file_get_contents($nexturl); $obj = json_decode($json, true); foreach($obj as $arr){ global $i, $client_id, $track_url; if($i){ $i++; } else { $i=1; } $track_id=$arr['id']; $title=$arr['title']; $uri=$arr['uri'].".json"; $uri = modify_url(array('client_id' => '6813c5d125013568ef986b73e4ba265c'), $uri); $json = file_get_contents($uri); $obj = json_decode($json, true); $sclink=$obj['permalink_url']; $streamable=$obj['streamable']; $downloadable=$obj['downloadable']; $download=$obj['download_url']; $stream=$obj['stream_url']; $pic=$obj['artwork_url']; $user=$obj['user']; $user_id=$user['id']; $user=$user['username']; if($streamable==false){ if($downloadable==true){ $stream=$download; } } if($streamable==false && $downloadable==false){ break; } $queryu = parse_url($stream, PHP_URL_QUERY); // Returns a string if the URL has parameters or NULL if not if( $queryu ) { $stream .= '&client_id='.$client_id; } else { $stream .= '?client_id='.$client_id; } $headers2=get_headers($stream,1); $location2=$headers2['Location']; if(!$location2){ $location2="/download.php?url=".$track_url; } $duration=$arr['duration']; if(!$pic){ $pic='http://dummyimage.com/100x100/000000/ffffff&amp;text=No+PIC'; } echo ' <h2 style="margin-bottom: 10px;">Download <?=$title?> (uploaded by <?=$user?>)</h2> <div id="dl" style="padding-bottom: 10px;border-bottom:1px solid #ccc;"> <img class="artwork" src="'.$pic.'" alt="'.$title.'" /> <div class="dl2"> <span class="h3">Title:</span> &nbsp; '.$title.'<br/> <span class="h3">Duration:</span> &nbsp; '.duration($duration).' <object style="position:relatvie;top:2px;display:block;" type="application/x-shockwave-flash" data="http://sc-downloader.com/assets/player.swf" id="audioplayer'.$i.'" height="24" width="290"> <param name="movie" value="http://sc-downloader.com/assets/player.swf"> <param name="FlashVars" value="playerID=audioplayer'.$i.'&amp;soundFile='.urlencode($location2).'&amp;text=0xdddddd"> <param name="quality" value="high"> <param name="menu" value="false"> <param name="wmode" value="transparent"> </object> <br/> <a class="btn" href="/download.php?url='.$sclink.'">Download</a> </div> <a href="'.$sclink.'" target="_blank" rel="nofollow" style="clear:both;float:right;text-decoration:underline;">View on SoundCloud</a> </div> '; if($i==10 || $i>10){ break; } } } if($_GET['dev']){ echo $i; } $currurl=getUrl(); $s = modify_url(array('action' => 'viewmore'), $currurl); $bs = modify_url(array('action' => 'topresults'), $currurl); if($_SESSION['next-search']){ echo '<a style="padding:5px;margin-bottom:10px;border:1px solid #666;background:#ccc;display:block;text-align:center;" href="'.$s.'">View More</a>'; } if($_GET['action']=='viewmore'){ echo '<br/><a style="margin-bottom:12px;text-align:center;display:block;font-size:10px;text-decoration:underline;" href="'.$bs.'">(go to top results)</a>'; } } else { ?> <?php if($_GET['msg']){ ?> <p class="error"> <?=htmlentities($_GET['msg'])?> </p> <?php } ?> <div style="margin-top:50px;"> <h2>Recent Search keywords</h2> <p style="margin:20px;"> <?php $q1=mysql_query("SELECT * FROM `$tbl2` ORDER BY `id` DESC LIMIT 20") or die("error"); while($r=mysql_fetch_array($q1)){ echo "<a style='font-size:12px;' href='/search/".$r['keyword']."'>".str_replace("+"," ", $r['keyword'])."</a> &bull; "; } ?> </p> </div> <div style="margin-top:200px;">&nbsp;</div> <?php } require_once("assets/footer.php"); if($keyword){ $keyword=str_replace(" ", "+", $keyword); $keyword=mysql_real_escape_string($keyword); $q1=mysql_query("SELECT * FROM `$tbl2` WHERE `keyword`='$keyword' LIMIT 1"); if(mysql_num_rows($q1)=='0'){ mysql_query("INSERT INTO `$tbl2` (keyword) VALUES ('$keyword')"); } else { mysql_query("DELETE FROM `$tbl2` WHERE `keyword`='$keyword'"); mysql_query("INSERT INTO `$tbl2` (keyword) VALUES ('$keyword')"); } } ?>
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: require_once(assets/config.php): failed to open stream: No such file or directory in /in/dFkku on line 2 Fatal error: require_once(): Failed opening required 'assets/config.php' (include_path='.:') in /in/dFkku on line 2
Process exited with code 255.
Output for hhvm-3.12.0
Fatal error: Uncaught Error: File not found: assets/config.php in /in/dFkku:2 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.0
Fatal error: File not found: assets/config.php in /in/dFkku on line 2
Process exited with code 255.