Form $_POST

No swearing, link posting, adult oriented, or illegal posts.
Post Reply
Chris
Site Admin
Posts: 62
Joined: Sat Jan 11, 2020 12:44 am

Form $_POST

Post by Chris »

One item that I like to use as much as possible is a Form. This allows users to enter their on information. If you go to the Roll Dice section, you will see a list of dice, number of times rolled, and the modifier. This section is used with $_GET.

If you look down, there is three boxes that users can enter their own information. This section is a Form that is filled out and handled inside of the code. More freedom for the users and more fun it becomes.

With this code, you use:

$in=$_POST["info"];

This part of information gets information from a form passed information.

To send this information, you will need the following code:

<form action="program.html" method="POST">
Choose the number being used: <input type="number" name="info" />
<input type="submit" style="cursor:crosshair" />
</form>

Using php, the lineswould look like:
echo"<form action='program.php' method='POST'>
Choose the number being used: <input type='number' name='info' />
<input type='submit style='cursor:crosshair' />
</form>";

The main thing that you will have to remember is that " is replaced by ' so that when it is run, there is no stop confusion and shows those lines that you would rather keep hidden.
One day, we will make it right!

Post Reply