Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://kltools.net/?s=&post_type%5B%5D=portfolio&post_type%5B%5D=post&post_type%5B%5D=page
- function submitchans(){
- for (var i=0;i<chans.length;i++)
- { var newHidInp = document.createElement('input');
- newHidInp.type = 'hidden';
- newHidInp.name = 'chans[]';
- newHidInp.value = chans[i];
- form.appendChild(newHidInp);
- }
- }
- function livearray(input){
- if (input != null) {
- chans.push(input);
- }
- if (Y === cSize){
- submitchans();
- document.forms[0].submit();
- }
- }
- <?php
- $page_to_load = $_POST[view];
- switch($page_to_load) {
- case '':
- echo "<script src="../scripts/jquery-3.2.0.min.js"></script>";
- echo "<script type="application/javascript" src="../scripts/raid.js"></script>";
- echo "<font size="+3" color="#FFFFFF">Who should I host?<br>Please wait while channel is selected<br></font>";
- echo "<font size="+2">";
- echo "<br><br>";
- echo "<img src="../_images/ajax_loader_blue_350.gif">";
- $servername = "localhost";
- $username = "username";
- $password = "password";
- $dbname = "database";
- $chanarray[] = null;
- $offline = 0;
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT `TwitchNames` FROM TK_Members WHERE Validated='1' AND RaidMe='1'";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- // output data of each row
- while($row = $result->fetch_assoc()) {
- array_push($chanarray, $row['TwitchNames']);
- }
- } else {
- echo "0 results";
- }
- array_splice($chanarray, 0, 1);
- $conn->close();
- echo "<script type="application/javascript">";
- echo "var channels = ". json_encode($chanarray);
- echo "</script>";
- echo "</font>";
- echo "<form id="form" method="post">";
- echo "<input type="hidden" name="view" value="page2">";
- echo "</form>";
- break;
- case 'page2':
- echo "<font size="+3" color="#FFFFFF">Who should I host?<br>";
- echo "Your channel to host is:<br></font>";
- echo "<font size="+2">";
- echo "<br><br>";
- $chans[] = null;
- $test = $_POST['outArray'];
- foreach ($test as $chan) {
- $temparray = array(rand(),$chan);
- array_push($chans, $temparray);
- }
- array_splice($chans,0,1);
- sort($chans);
- echo "<a href="https://twitch.tv/".$chans[0][1]."" target="_blank">".$chans[0][1]."</a>";
- echo "<br><br><br>";
- echo "<a href="whoslive.htm" target="_parent">See All Live Channels</a>";
- echo "</font>";
- break;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement