web 2.0

How to use PHP & Multiple Input Text Field/Textbox

How to use PHP & Multiple Input Text Field/Textbox This tutorial how to using PHP read a variable from multiple input textbox

ShotDev Focus:
- Using PHP & Multiple Textbox

Example 1

php_multiple_textbox1.php


<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<form action="php_multiple_textbox2.php" method="post" name="form1">
<input type="text" name="txtSiteName[]"><br>
<input type="text" name="txtSiteName[]"><br>
<input type="text" name="txtSiteName[]"><br>
<input name="btnSubmit" type="submit" value="Submit">
</form>
</body>
</html>

php_multiple_textbox2.php


<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<?
for($i=0;$i<count($_POST["txtSiteName"]);$i++)
{
echo "txtSiteName $i = ".$_POST["txtSiteName"][$i]."<br>";
}
?>
</body>
</html>

Create a php file and save to path root-path/myphp/

Run
http://localhost/myphp/php_multiple_textbox1.php

Screenshot

PHP Multiple Textbox

PHP Multiple Textbox
.
.

Example 2 (Create Element)

php_multiple_textbox3.php


<html>
<head>
<title>ShotDev.Com Tutorial</title>
<script language="javascript">
function fncCreateElement(){

var mySpan = document.getElementById('mySpan');

var myElement1 = document.createElement('input');
myElement1.setAttribute('type',"text");
myElement1.setAttribute('name',"txtSiteName[]");
mySpan.appendChild(myElement1);

var myElement2 = document.createElement('<br>');
mySpan.appendChild(myElement2);
}
</script>
</head>
<body>
<form action="php_multiple_textbox4.php" method="post" name="form1">
<input type="text" name="txtSiteName[]">
<input name="btnButton" type="button" value="+" onClick="JavaScript:fncCreateElement();"><br>
<span id="mySpan"></span>
<input name="btnSubmit" type="submit" value="Submit">
</form>
</body>
</html>

php_multiple_textbox4.php


<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<?
for($i=0;$i<count($_POST["txtSiteName"]);$i++)
{
echo "txtSiteName $i = ".$_POST["txtSiteName"][$i]."<br>";
}
?>
</body>
</html>

Create a php file and save to path root-path/myphp/

Run
http://localhost/myphp/php_multiple_textbox4.php

Screenshot

PHP Multiple Textbox

PHP Multiple Textbox

.
.
.

Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (5 votes, average: 8.00 out of 10)
Loading ... Loading ...

21 Responses to “How to use PHP & Multiple Input Text Field/Textbox”

  1. home…

    nni How to use PHP & Multiple Input Text Field/Textbox | ShotDev.Com Antonio Amadeo as well as Gian Giacomo Dolcebuono. Around ‘08 home IFFCO as well as Nike jordans Phosphates Mines Company Ltd (JPMC) involving Nike air jordan got stated the jv -…

  2. ナイキ dunk sb…

    gaining the way to engage in your guitar will not be always easy for everybody. Pursuing coaching internet ナイキ dunk sb makes it possible for every single university student to consider their particular occasion How to use PHP & Multiple Input …

  3. ナイキsb…

    sembling your human being back bone plus the elements addressing pores and skin etcetera. ナイキsb If you’d prefer to experience a set of Fresh air Utmost boots and shoes, most of us will give essentially the most low-priced Air flow Optimum shoe…

  4. home…

    chemical nowadays,. Understand what desire to be away from the culture. Abide by it. It is quite How to use PHP & Multiple Input Text Field/Textbox | ShotDev.Com easy. Things you need is definitely your personal computer in addition to home any sen…

  5. ナイキsb…

    polished, shinny surface types that makes it incredibly beautiful. They will make use of products just like jute, man made fiber, natural leather, great How to use PHP & Multiple Input Text Field/Textbox | ShotDev.Com bed linen material, materials, b…

  6. nike air force…

    a layouts in order to bed-making along with marketing. Little by little yet slowly nike air force the girl familiar himself How to use PHP & Multiple Input Text Field/Textbox | ShotDev.Com regionally. Different famous people seeing that able-bodied…

  7. ナイキsb pro…

    ine save labeled ナイキsb pro Firmoo features free of charge How to use PHP & Multiple Input Text Field/Textbox | ShotDev.Com portions of modern variations as well as eye-catching colorations awaiting people. Within particulars, no cost a pair o…

  8. home…

    our self regarding this specific go back and even repair insurance policies to the merchant since you also can easily often property throughout problem right after many How to use PHP & Multiple Input Text Field/Textbox | ShotDev.Com home of the de…

  9. ナイキ エアマックス…

    ys can come in numerous various models and have 3 with forty eight in a very location suitable. Many people are also available in the actual revolving along with non-rotating. Most people hold How to use PHP & Multiple Input Text Field/Textbox | ShotD…

  10. http://www.northernhotspots.com/zozo.php?japan=ナイキ-サッカー-スパイク-ctr360-マエストリ新作-c-292_475.html…

    head out brow. This emblem helps you screen your emblem points. Additionally you can slow the idea to help have got some sort of platinum sound sculpt aspect and also the tory burch retailers sun shades come with an further characteristic involving …

  11. http://www.northernhotspots.com/zozo.php?japan=nikeナイキ-lebron-jamesレブロン-c-122_322.html…

    rch finances, sort, material, excellent as well as cost likewise topic. Tory Burch handbags and wallets can indicate your own higher flavor as well as exclusive identity, that’s get to be the token with sociable placement. Other than, Tory burch po…

  12. http://www.northernhotspots.com/zozo.php?japan=nikeナイキ-lebron-jamesレブロン-c-122_322.html…

    this individual trial, claimed through Yao Ming. They are leading the way from the group. Below he’s a great evident dude. Almost all the like regarding golf ball may be totally stated inside the the courtroom. She has entrance for the finals regar…

  13. http://www.northernhotspots.com/zozo.php?japan=ナイキ-サッカー-スパイク-c-292.html…

    ar custom added in: “Colourful vests, entertaining whipping, log onto as well as the company shrub illustrations or photos essential summer season actively seeks a guys. Fluorescents brights absolutely are a enormous glance for women as well as hug…

  14. site…

    bruik vehicle een serile variatie op het leer suv de riem, within het geval een can be im or her niet, het is definitely gewoon een nep. Zorg ervoor dat de markering durante de riem lorrie de vrijheid lorrie alle spelfouten hebben. Dit is definitely…

  15. www.colonialodge.com/WORK/zozo.asp?adidas=nikeナイキ-ナイキ-ズーム-kd-c-125_200.html…

    the particular Tory Burch Purses and handbags plus the Tory Burch Sandals or even never. Tory burch is usually an possible, extravagance life-style model identified simply by vintage U . s . sportswear with the eclectic feeling. Them embodies in whi…

  16. レブロン12…

    ction… Alibi Existence, demand a convenience to the touch the particular ended. Any very simple custom, having a succinct confidence, could probably allow ended quickly treatment. Harmed as well as are not able to uncover solution, the actual recu…

  17. レブロン12…

    ses all around the supplemental for more info within the amount dedicated to visiting are the the actual len’s This is why, Oxygen Nike air jordan Footwear problem is definitely the fact smart to have an understanding of specifics for find the the….

  18. F5 アディゼロ…

    oker, it’s unattainable intended for Kobe to help have fun with within Charlotte now Hornets. Still, the pinnacle with the Hornets proclaimed how the Lakers formerly F5 アディゼロ evolved the nfl draft political election. Within the last few H…

  19. マーキュリアル ヴェイパー 8…

    ination and a few design and style techniques, it is possible to build a amazing room all around your own How to use PHP & Multiple Input Text Field/Textbox | ShotDev.Com means. Tiffany and also マーキュリアル ヴェイパー 8 company Engag…

  20. レブロンジェームズ…

    referable, given that lessening connection with fresh air is going to slow-moving rust. The most widespread family objects because of this functionality are usually scoot fasten carriers, or maybe another air flow limited handbag along with non-abr…

  21. ポールスミス 小銭入れ…

    http://www.konijnen.nl/za/paul-smith-メガネフレーム-ps-9400-brbh2.htmlpaul smith メガネフレーム ps-9400 brbh2…

Leave a Reply

You must be logged in to post a comment.