} else { $Content .= $key2 . " = \"" . $elem . "\"\n"; } } } if (!($Handle = fopen($File, 'w'))) { return false; } if (!fwrite($Handle, $Content)) { return false; } fclose($Handle); return true; } } print '<h1>Steam Profiles Ini Writer</h1><br />'; if (!form::submitted()) { print "<form id=\"search\" action=\"" . val::encode($_SERVER['PHP_SELF']) . "\" method=\"post\">\r\n\t\tSteam Executable Location: <input type=\"text\" name=\"File\" style=\"width: 250px;\" value=\"C:\\Program Files\\Steam\\steam.exe\" /><br />\r\n\t\tAdditional Steam Parameters: <input type=\"text\" name=\"Parameters\" style=\"width: 250px;\" value=\"\" /><br />\r\n\t\tYour SteamID: <input type=\"text\" name=\"SteamID\" style=\"width: 250px;\" value=\"STEAM_\" /><br />\r\n\t\t<br />\r\n\t\tSteam profiles:<br />\r\n\t\t<div id=\"profiles\">\r\n\t\t\tUsername: <input type=\"text\" name=\"Username[]\" /> Password: <input type=\"text\" name=\"Password[]\" /><br />\r\n\t\t</div>\r\n\t\t<input type=\"button\" onclick=\"document.getElementById('Profiles').innerHTML += 'Username: <input type="text" name="Username[]" /> Password: <input type="password" name="Password[]" /><br />';\" value=\"Add Profile\" />\r\n\t\t<input type=\"submit\" value=\"Create\" />\r\n\t</form>"; } else { if (form::submitted()) { $Data = array('Steam' => array('File' => $_POST['File'], 'Parameters' => null, 'Force' => 'false', 'SteamID' => $_POST['SteamID']), 'Profiles' => array()); foreach ($_POST['Username'] as $index => $username) { $Data['Profiles'][$index] = $_POST['Username'][$index] . ' ' . $_POST['Password'][$index]; } if (SteamProfilesIni::WriteIniFile($Data, 'SteamProfiles.ini', true)) { print 'Success!'; } else { print 'An error occured.'; } } }
$string = file_get_contents("data/regis.json"); $j = json_decode($string, true); if (array_key_exists($value1, $j) == TRUE) { echo -1; } else { $j[$value1] = $value2; $string = json_encode($j); file_put_contents("data/regis.json", $string); } } function inser1($value1, $value2) { $string = file_get_contents("data/teach.json"); $j = json_decode($string, true); if (array_key_exists($value1, $j) == TRUE) { echo -1; } else { $j[$value1] = $value2; $string = json_encode($j); file_put_contents("data/teach.json", $string); } } } if (isset($_POST['uid'])) { $v1 = new val(); if ($_POST['t'] == 0) { $v1->inser($_POST['uid'], $_POST['pwd']); } else { $v1->inser1($_POST['uid'], $_POST['pwd']); } }