dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: error receiving count of $ post

  1. #1
    Join Date
    May 2014
    Posts
    28

    Unhappy error receiving count of $ post

    i have this code

    <!DOCTYPE html>
    <!--
    To change this license header, choose License Headers in Project Properties.
    To change this template file, choose Tools | Templates
    and open the template in the editor.
    -->
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Our Local site</title>

    </head>
    <body>
    <form action="welcome.php" method="post">
    <input id="t1" name="t1"type="text" placeholder="table name"><br>
    <input id="s1"type="text" name="skill[]"placeholder="skill or item or spec">
    <input id="s2" type="text" name="skill[]" placeholder="skill or item or spec">
    <input id="s3" type="text" name="skill[]" placeholder="skill or item or spec">
    <input id="s4"type="text" name="skill[]" placeholder="skill or item or spec">
    <input id="s5"type="text" name="skill[]" placeholder="skill or item or spec">
    <input id="s6"type="text" name="skill[]" placeholder="skill or item or spec">
    <input id="s7"type="text" name="skill[]" placeholder="skill or item or spec">
    <input id="s8"type="text" name="skill[]" placeholder="skill or item or spec">
    <input id="s9"type="text" name="skill[]" placeholder="skill or item or spec">
    <input id="c1"type="text" name="city[]"placeholder="city">
    <input id="c2"type="text" name="city[]"placeholder="city">
    <input id="c3"type="text" name="city[]" placeholder="city">
    <input id="c4"type="text" name="city[]" placeholder="city">
    <input id="c5"type="text" name="city[]" placeholder="city">
    <input id="c6"type="text" name="city[]"placeholder="city"><br>
    <input id="r1"type="text" name="region[]"placeholder="Region in city">
    <input id="r2"type="text" name="region[]" placeholder="Region in city">
    <input id="r3"type="text" name="region[]" placeholder="Region in city">
    <input id="cn1"type="text" name="country[]" placeholder="country">
    <input id="cn2"type="text" name="country[]" placeholder="country">
    <input id="cn3"type="text" name="country[]" placeholder="country">
    <input id="l1"type="text" name="lat"placeholder="Latitude in degrees">
    <input id="l2"type="text" name="long"placeholder="Longitude in degrees">
    <input type="submit">
    </form>
    </body>
    </html>


    upon counting $post

    $sk= $_POST;

    print_r(count($sk));

    gives output as 7...should be gerater tahn 7 as no of textboxes are more...what shoud i do to get real value..

  2. #2
    Join Date
    Jul 2013
    Location
    Voorheesville NY USA
    Posts
    889
    Your inputs are arrays themselves so you have to count each item in each named array.

    Have you thought about your design? How are you going to relate the multiple inputs of city,region and country to each other? And why do you allow multiple city or country values but only one lat/long pair?

    And why have you ignored the advice you were given about using labels?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles