function createToken() { $newtoken = "TKN"; for ($i = 0; $i < 3; $i++) { $newtoken = $newtoken . randLetter(); } for ($j = 0; $j < 11; $j++) { $newtoken = $newtoken . rand(0, 9); } return $newtoken; }
<?php function randLetter() { $int = rand(0, 51); $a_z = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; $rand_letter = $a_z[$int]; return $rand_letter; } $secretCode = "rTr"; $string = ""; for ($i = 0; $i < 7; $i++) { $string = $string . randLetter(); } $string = $string . $secretCode; for ($i = 0; $i < 10; $i++) { $string = $string . randLetter(); } echo "code={$string}";
border:none; letter-spacing:5px; color:#CCCCCC; } .refresh{ background:none; border:none; color:#0000CC; font-weight:600; } </style> <form enctype="multipart/form-data" onclick="reload();" method="post"> <?php function randLetter() { $int = rand(0, 54); $a_z = "abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; $rand_letter = $a_z[$int]; return $rand_letter; } echo "<input type='text' class='captcha' name='cap' id='cap' value='"; for ($i = 1; $i <= 6; $i++) { echo randLetter(); } echo "' disabled>"; ?> <br />Can't read the image?click <input type="submit" value="here" onclick="reload();" class="refresh"/> </form>
* Time: 18:43 */ function randLetter() { $abc = "abcdefghijklmnopqrstuvwxyz"; $abcLength = strlen($abc); $string = ""; for ($i = 0; $i < 8; $i++) { $abcRand = rand(0, $abcLength - 1); $string .= $abc[$abcRand]; } return strtoupper($string); } $filename = $_FILES['fileToUpload']['name']; $extension = pathinfo($filename, PATHINFO_EXTENSION); $new = randLetter(); $newfilename = $new . "." . $extension; $uploadOk = 1; $imageFileType = pathinfo($filename, PATHINFO_EXTENSION); if (isset($_POST["submit"])) { $check = filesize($_FILES["fileToUpload"]["tmp_name"]); if ($check !== false) { $uploadOk = 1; } else { echo "Bestand moet een doc of docx zijn."; $uploadOk = 0; } } // Alleen doc of docx if ($imageFileType != "doc" && $imageFileType != "docx") { echo "Alleen doc en docx bestanden.";
<?php function randLetter() { $int = rand(0,51); $a_z = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; $rand_letter = $a_z[$int]; return $rand_letter; } if(!empty($_REQUEST['design'])) $args = array('s' => $_REQUEST['design'] , 'meta_query' => $meta_query , 'post_type' => 'attachment','post_status' => 'any','posts_per_page' => -1,'order' => 'ASC','orderby'=> 'menu_order','paged'=>$paged); else { $randLetter = randLetter(); $args = array('s' => $randLetter , 'meta_query' => $meta_query , 'post_type' => 'attachment','post_status' => 'any','posts_per_page' => -1,'order' => 'ASC','orderby'=> 'menu_order','paged'=>$paged); } ?> <br/> <br/> <div class = "search-result-design"> <?php $attachments = new WP_Query( $args ); if(count($attachments) == 0)