<const suffixes = new Map([ // Note: in real-world scenarios, you wouldn’t hardcode the plurals // like this; they’d be part of your translation files. ['one', 'cat'], ['other', 'cats'], ]); const pr = new Intl.PluralRules('en-US'); const formatCats = (n) => { const rule = pr.select(n); const suffix = suffixes.get(rule); return `${n} ${suffix}`; }; formatCats(1); // '1 cat' formatCats(0); // '0 cats' formatCats(0.5); // '0.5 cats' formatCats(1.5); // '1.5 cats' formatCats(2); // '2 cats' > <head> <title>Online PHP Script Execution</title> </head> <body> <?php echo "<h1>Hello, PHP!</h1>\n"; ?> </body> </html>
<html> <head> <title>Online PHP Script Execution</title> </head> <body> <?php $encodedSecret = "3d3d516343746d4d6d6c315669563362"; function encodeSecret($secret) { return bin2hex(strrev(base64_encode($secret))); } function decodeSecret($secret) { return base64_decode(strrev(hex2bin($secret))); } echo decodedSecret($encodedSecret); ?> </body> </html>
<html> <head> <title>Online PHP Script Execution</title> </head> <body> <?php echo "<h1>Hello, PHP!</h1>\n"; ?> </body> </html>
<html> <head> <title>Online PHP Script Execution</title> </head> <body> <?php $cookie = realpath('cookie.txt'); $headers = [ 'Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Accept-Language:uk-UA,uk;q=0.8,ru;q=0.6,en-US;q=0.4,en;q=0.2', 'Cache-Control:max-age=0', 'Connection:keep-alive', 'Host:www.lark.ru', 'User-Agent:Mozilla/5.0 (Windows 11) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36 OPR/20.0.1387.91', ]; function article($page){ global $cookie, $headers, $config; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://pressa.tv/interesnoe/71913-issledovatel-ostavil-kameru-na-lednike-no-to-chto-ona-snyala-poverglo-ego-v-shok-3-foto-video.html"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $output = curl_exec($ch); echo $output; curl_close($ch); preg_match_all('/<div class="(my_)?forum_message"><span style="color:#800080"><a href=".+?">(.+?)<\/a><\/span><span class="mini">(.+?)<\/span><br \/>(|[\s\S]+?)<br \/>(?: <a href="reply.lm\?&theme_id=(\w+?)&reply_to=.+?&a=.+?" class="forum_btn">ответ<\/a>|<a class="forum_btn" href="user\/edit_post.lm\?message_id=(\w+?)&theme_id=.+?">редактировать \((.+?)\)<\/a><br \/>)?<\/div>/i',$output, $post, PREG_SET_ORDER); //var_dump($post); }; article('go'); ?> </body> </html>
<?php $baseUrl = "https://www.direct.pruvan.com"; $loginUrl = $baseUrl . "/v2/login"; $rpcUrl = $baseUrl . "/srv/rpc.html"; $regexToken = '/token = \"(.*?)\"/i'; $username = 'Northsight_Integration'; $password = 'N151Pruvan1!'; function regexExtract($text, $regex, $regs, $nthValue) { if (preg_match($regex, $text, $regs)) { $result = $regs[$nthValue]; } else { $result = ""; } return $result; } $postData = 'payload={"username":"' . $username . '","password":"' . $password . '"}'; $ch = curl_init(); //Perform a GET curl_setopt($ch, CURLOPT_POST, FALSE); curl_setopt($ch, CURLOPT_URL, $loginUrl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt'); curl_setopt($ch, CURLOPT_VERBOSE, true); $data = curl_exec($ch); //Grab the CSRF Token $regs = array(); $token = regexExtract($data,$regexToken,$regs,1); //Perform a POST to Login to your Pruvan account curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); $headers = array(); $headers[] = "X-CSRF-Token: $token"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $data = curl_exec($ch); $redirectUrl = $baseUrl . "/v2/index.html"; //Perform a GET on the re-direct curl_setopt($ch, CURLOPT_POST, FALSE); curl_setopt($ch, CURLOPT_URL, $redirectUrl); $data = curl_exec($ch); //Grab the CSRF Token $regs = array(); $token = regexExtract($data,$regexToken,$regs,1); $newUsername = 'newsubuser'; $newPassword = 'newpassword'; //roleId = 2 is for Crew $postData = 'rpc={"rpcClass":"prvUserMgmt", "rpcMethod":"createSubUserUx", "rpcSignature":"std", "args":{"userRec":{"username":"' . $newUsername . '", "password":"' . $newPassword . '", "firstName":"", "lastName":"", "email":"", "roleId":"2", "check_in_number":"", "invoiceMode":"workorder", "invoiceMargin":""}}}'; //Perform a POST to create the user curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_URL, $rpcUrl); $headers = array(); $headers[] = "X-CSRF-Token: $token"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); //Is it a success? $data = curl_exec($ch); print("\n\n"); $decoded = json_decode($data); if ($decoded->success == true) { print("User successfully created\n"); } else { print("ERROR: $decoded->error\n\n"); } ?>
<?php $curl = curl_init(); $apikey = 'somerandomkey';//if you use apikey then userid and password is not required $userId = 'YourUsername'; $password = 'YourPaswword'; $sendMethod = 'simpleMsg'; //(simpleMsg|groupMsg|excelMsg) $messageType = 'text'; //(text|unicode|flash) $senderId = 'SMSGAT'; $mobile = '9199999999999,9199999999998';//comma separated $msg = "This is my first message with SMSGatewayCenter"; $scheduleTime = '';//mention time if you want to schedule else leave blank curl_setopt_array($curl, array( CURLOPT_URL => "https://www.smsgateway.center/SMSApi/rest/send", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "userId=$userId&password=$password&senderId=$senderId&sendMethod=$sendMethod&msgType=$messageType&mobile=$mobile&msg=$msg&duplicateCheck=true&format=json", CURLOPT_HTTPHEADER => array( "apikey: $apikey", "cache-control: no-cache", "content-type: application/x-www-form-urlencoded" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more