How to create a website like Random.org

Random.org is a site that provides a function whereby the site assigns a random number according to the selection we want.

Ordinarily, the random.org website is often used as the draw for a website give away or give away prizes, but behind the coolness of the random.org site, it turns out that creating a random.org site is very easy and can possibly be done in as little as 2 seconds.

preparation

XAMPP application for testing without internet connection or can use hosting / cpanel

How to create a site like random.org can use the PHP (Hypertext Preprocessor) programming language by adding. used function Edge(), function rand () is a function easy to deliver arbitrarily from variables which is entered in function the edge(). Here is a simple tutorial using the random function

An example of the result of the simple script above is

5

Now that we’ve learned about the rand () function, let’s move on to the part to create a simple system like the random.org site. The script we need is to create 2 variables ($ min and $ max) which value from both variables these are the first number and the second number (minimum and maximum), an example of using the script looks like this.

From the results of the script above, it can be seen that the response returned is the same as the previous simple script. However, the difference between the two scripts above is the use of separate variables. From the two scripts it can be clearly seen that for the second script the placement of the numbers is outside of the rand () function and the $ min and $ max uses variables.

Now that we understand the script above, let’s move on to the tutorial section where we will create a simple form or form like the one on the random.org website. Here we need 2 input forms and 1 submit form, then give an action to display the results of the rand () function, so for this part we need 2 files, namely the file for the form and 1 more file for the response results, here is an example of using the script

form.php



in the form tag we use the post method and the action leads to the second file that is randon.phpwho have accepted random.php value or the content of the 2 text fields available on form.php using the name form, namely min and max

random.php

in the variables $ min and $ max the value is $ _POST[‘min’] and $ _POST[‘max’] since the post method is used in the form.php script, the variables to be used must also be posted.

answer

4 // ini hanya contoh responnya saja, hasil responnya hanya menunjukan sebuah teks tanpa tombol atau tampilan lain

Complete. To create a website like Random.org, you can also make it available online and to many people with free hosting. Please read the article on how to get free hosting on Inwepo.

Also Read: How To Get Free Hosting On The Latest 000webhost






Leave a Reply

Your email address will not be published.