Hi… welcome… in my page….
Still in PHP… yeah…
Now… I want to giving you about PHP and title discuss of
“method POST in PHP”.. Yon know previous…???.. Method POST in PHP is command
for go to other page or other “url”… Usually programmer using “button” for move
or goto other url…
Ok.. direct in program…., I want making program using
“checkbox”, “radio”. … ok check it….
You can copy this coding and paste in your notepad
First step :
<html>
<head> METHOD POST IN PHP <br> <br>
<br>
<title> WE ARE KNOWLEDGE </title>
</head>
<body>
<form method = POST action = "20.php">
<?php
echo "<table border = 7>
<tr> <td> HARDWARE </td> <td>
<input type = radio name = r value = HARDISK>
HARDISK <br>
<input type = radio name = r value = DVD ROOM> DVD
ROOM <br>
<input type = radio name = r value = FLASH_DISK> FLASH
DISK <br>
<input type = radio name = r value = MODEM> MODEM <br>
<input type = radio name = r value = SOUND_CARD> SOUND
CARD <br></td>
</tr>
<tr>
<td> SOFTWARE </td> <td>
<input type = checkbox name = 's[]' value = PHP> PHP
<br>
<input type = checkbox name = 's[]' value = VB.NET>
VB.NET <br>
<input type = checkbox name = 's[]' value = HTML> HTML
<br>
<input type = checkbox name = 's[]' value =
JAVASCRIPT> JAVASCRIPT <br>
<input type = checkbox name = 's[]' value = ORACLE>
ORACLE <br> </td>
</tr>
<tr>
<td> </td> <td> <input type = submit
value = SEND </td>
</tr>
</table>";
?>
</body>
</html>
Save with save as type = ”PHP”.
Second step :
Copy this coding and paste in your notepad
<?php
$a = count($_POST['s']);
echo
$_POST[r]."<br>"."<br>";
for ($x = 0; $x < $a; $x++)
{
echo $_POST['s'][$x]."<br>";
}
?>
If it save with save as type = “PHP”.. DON’T forgt give name
= “20.php”
………..
……….
And result:
METHOD POST IN PHP
HARDWARE
|
HARDISK
DVD ROOM FLASH DISK MODEM SOUND CARD |
SOFTWARE
|
PHP
VB.NET HTML JAVASCRIPT ORACLE |
<=""
td="">
|
If you
choice flash disk, php, vb.net, oracle …
and clcik “send’
Result is
FLASH_DISK
PHP
VB.NET
ORACLE
PHP
VB.NET
ORACLE
Ok..
just it.. I hope you understand with this all…
Thanks
for you
Se
you later..
No comments:
Post a Comment