yashwanth@cwebsites.com

Discussion in 'PHP' started by kyashwanthreddy, May 17, 2010.

  1. #1
    In php how to get form post variable count?
    In my php page when am submitting form( which has more than 500 fields), no action is done? Can any anyone tel why it is not doing any thing?

    thanks,
    Yash k
     
    kyashwanthreddy, May 17, 2010 IP
  2. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #2
    Use REQUSET Function in the main function script to get all your data's posted using Post or Get
     
    roopajyothi, May 17, 2010 IP
  3. mfscripts

    mfscripts Banned

    Messages:
    319
    Likes Received:
    4
    Best Answers:
    8
    Trophy Points:
    90
    Digital Goods:
    3
    #3
    Wow, that's a big form! Can you post (some of) the form code so we can help debug it?
     
    mfscripts, May 17, 2010 IP
  4. lukeg32

    lukeg32 Peon

    Messages:
    645
    Likes Received:
    19
    Best Answers:
    1
    Trophy Points:
    0
    #4
    The same with any other array - use sizeof($_POST)

    (or count($_POST) - same thing).

    Do you mean when you try to submit the form, nothing is done? What is your form declaration?

    If you are using input type = submit, make sure it is inside your form tags.
    If you are using a 'button' you need to attach an onclick handler to it.
     
    lukeg32, May 17, 2010 IP
  5. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #5
    The op nothing said clearly!
    Better he have state what he needs exactly!
    Anyway your post answer in a common manner!
     
    roopajyothi, May 17, 2010 IP
  6. kyashwanthreddy

    kyashwanthreddy Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    thanks for your reply. am getting exact count of post variables, but when am submitting a form i wrote submit action, nothing seems working...
    here is sample code i wrote..
    <?
    if(isset($_POST['submit']))
    {
    // code to be executed.....
    }

    echo "<form action='' method='post'>";
    echo "<input type='text' name='tf1'>";
    echo "<input type='text' name='tf2'>";
    .....
    ...
    ...
    echo "<input type='submit' name='submit' value='submit'>";
    echo "</form>";
    ?>
    when i submit the form that isset($_POST['submit']) is not executing...it is not entering into that function. if i decrease the posting fields count it is working perfectly..i know their is no limit of posting fields, and i increased post max size 64MB to 256MB. still it is not working. can any one help why it is not working??
     
    kyashwanthreddy, May 17, 2010 IP
  7. abstractworld

    abstractworld Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hmmm
    try multipart..
    <form action="" method="post" enctype="multipart/form-data">

    and check what happens if you put submit button at top..
    also before isset check for submit...try to get all post data and debug what is going on like this:
    echo '<pre>';
    var_dump($_POST);

    Thanks
     
    abstractworld, May 17, 2010 IP
  8. kyashwanthreddy

    kyashwanthreddy Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thanks for your reply sir, after your reply i tried using enctype='multipart/form-data' and var_dump($_post). As a result In array it is showing only 70 posted values, but am posting more dan 100 values.
     
    kyashwanthreddy, May 17, 2010 IP
  9. kyashwanthreddy

    kyashwanthreddy Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    helo everyone,

    Attached sample1.jpeg file is my page where i limite results per page is 100. i selected all check boxes and submitting form. the following result is dumping all post values.
    result: array(136) {
    ["ids_assigned"]=>
    string(3) "100"
    ["client_id"]=>
    string(3) "209"
    ["ids_used"]=>
    string(3) "100"
    ["pagenum"]=>
    string(1) "1"
    ["chk1"]=>
    string(4) "8858"
    ["password8858"]=>
    string(0) ""
    ["accounts_id"]=>
    string(4) "8792"
    ["chk2"]=>
    string(4) "8857"
    ["password8857"]=>
    string(0) ""
    ["chk3"]=>
    string(4) "8856"
    ["password8856"]=>
    string(0) ""
    ["chk4"]=>
    string(4) "8855"
    ["password8855"]=>
    string(0) ""
    ["chk5"]=>
    string(4) "8854"
    ["password8854"]=>
    string(0) ""
    ["chk6"]=>
    string(4) "8853"
    ["password8853"]=>
    string(0) ""
    ["chk7"]=>
    string(4) "8852"
    ["password8852"]=>
    string(0) ""
    ["chk8"]=>
    string(4) "8851"
    ["password8851"]=>
    string(0) ""
    ["chk9"]=>
    string(4) "8850"
    ["password8850"]=>
    string(0) ""
    ["chk10"]=>
    string(4) "8849"
    ["password8849"]=>
    string(0) ""
    ["chk11"]=>
    string(4) "8848"
    ["password8848"]=>
    string(0) ""
    ["chk12"]=>
    string(4) "8847"
    ["password8847"]=>
    string(0) ""
    ["chk13"]=>
    string(4) "8846"
    ["password8846"]=>
    string(0) ""
    ["chk14"]=>
    string(4) "8845"
    ["password8845"]=>
    string(0) ""
    ["chk15"]=>
    string(4) "8844"
    ["password8844"]=>
    string(0) ""
    ["chk16"]=>
    string(4) "8843"
    ["password8843"]=>
    string(0) ""
    ["chk17"]=>
    string(4) "8842"
    ["password8842"]=>
    string(0) ""
    ["chk18"]=>
    string(4) "8841"
    ["password8841"]=>
    string(0) ""
    ["chk19"]=>
    string(4) "8840"
    ["password8840"]=>
    string(0) ""
    ["chk20"]=>
    string(4) "8839"
    ["password8839"]=>
    string(0) ""
    ["chk21"]=>
    string(4) "8838"
    ["password8838"]=>
    string(0) ""
    ["chk22"]=>
    string(4) "8837"
    ["password8837"]=>
    string(0) ""
    ["chk23"]=>
    string(4) "8836"
    ["password8836"]=>
    string(0) ""
    ["chk24"]=>
    string(4) "8835"
    ["password8835"]=>
    string(0) ""
    ["chk25"]=>
    string(4) "8834"
    ["password8834"]=>
    string(0) ""
    ["chk26"]=>
    string(4) "8833"
    ["password8833"]=>
    string(0) ""
    ["chk27"]=>
    string(4) "8832"
    ["password8832"]=>
    string(0) ""
    ["chk28"]=>
    string(4) "8831"
    ["password8831"]=>
    string(0) ""
    ["chk29"]=>
    string(4) "8830"
    ["password8830"]=>
    string(0) ""
    ["chk30"]=>
    string(4) "8829"
    ["password8829"]=>
    string(0) ""
    ["chk31"]=>
    string(4) "8828"
    ["password8828"]=>
    string(0) ""
    ["chk32"]=>
    string(4) "8827"
    ["password8827"]=>
    string(0) ""
    ["chk33"]=>
    string(4) "8826"
    ["password8826"]=>
    string(0) ""
    ["chk34"]=>
    string(4) "8825"
    ["password8825"]=>
    string(0) ""
    ["chk35"]=>
    string(4) "8824"
    ["password8824"]=>
    string(0) ""
    ["chk36"]=>
    string(4) "8823"
    ["password8823"]=>
    string(0) ""
    ["chk37"]=>
    string(4) "8822"
    ["password8822"]=>
    string(0) ""
    ["chk38"]=>
    string(4) "8821"
    ["password8821"]=>
    string(0) ""
    ["chk39"]=>
    string(4) "8820"
    ["password8820"]=>
    string(0) ""
    ["chk40"]=>
    string(4) "8819"
    ["password8819"]=>
    string(0) ""
    ["chk41"]=>
    string(4) "8818"
    ["password8818"]=>
    string(0) ""
    ["chk42"]=>
    string(4) "8817"
    ["password8817"]=>
    string(0) ""
    ["chk43"]=>
    string(4) "8815"
    ["password8815"]=>
    string(0) ""
    ["chk44"]=>
    string(4) "8814"
    ["password8814"]=>
    string(0) ""
    ["chk45"]=>
    string(4) "8813"
    ["password8813"]=>
    string(0) ""
    ["chk46"]=>
    string(4) "8812"
    ["password8812"]=>
    string(0) ""
    ["chk47"]=>
    string(4) "8811"
    ["password8811"]=>
    string(0) ""
    ["chk48"]=>
    string(4) "8810"
    ["password8810"]=>
    string(0) ""
    ["chk49"]=>
    string(4) "8809"
    ["password8809"]=>
    string(0) ""
    ["chk50"]=>
    string(4) "8808"
    ["password8808"]=>
    string(0) ""
    ["chk51"]=>
    string(4) "8807"
    ["password8807"]=>
    string(0) ""
    ["chk52"]=>
    string(4) "8806"
    ["password8806"]=>
    string(0) ""
    ["chk53"]=>
    string(4) "8805"
    ["password8805"]=>
    string(0) ""
    ["chk54"]=>
    string(4) "8803"
    ["password8803"]=>
    string(0) ""
    ["chk55"]=>
    string(4) "8802"
    ["password8802"]=>
    string(0) ""
    ["chk56"]=>
    string(4) "8801"
    ["password8801"]=>
    string(0) ""
    ["chk57"]=>
    string(4) "8800"
    ["password8800"]=>
    string(0) ""
    ["chk58"]=>
    string(4) "8799"
    ["password8799"]=>
    string(0) ""
    ["chk59"]=>
    string(4) "8798"
    ["password8798"]=>
    string(0) ""
    ["chk60"]=>
    string(4) "8797"
    ["password8797"]=>
    string(0) ""
    ["chk61"]=>
    string(4) "8796"
    ["password8796"]=>
    string(0) ""
    ["chk62"]=>
    string(4) "8795"
    ["password8795"]=>
    string(0) ""
    ["chk63"]=>
    string(4) "8794"
    ["password8794"]=>
    string(0) ""
    ["chk64"]=>
    string(4) "8793"
    ["password8793"]=>
    string(0) ""
    ["chk65"]=>
    string(4) "8792"
    ["password8792"]=>
    string(0) ""
    ["chk66"]=>
    string(4) "8791"
    }

    Here am posting 204 values but it shows only 136 values ?? can any one tell me why it is not posting all values??
     

    Attached Files:

    kyashwanthreddy, May 18, 2010 IP
  10. abstractworld

    abstractworld Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    hmmm... did you increase the post_max size in php.ini?
    Oh may be php is passing its max execution time...usually it is set to 30 secs... So if your script is taking more than this to run it will not work...try increasing this too. And restart your webserver too.

    and another thing try your script on some other running server too...

    Thanks...
     
    abstractworld, May 19, 2010 IP
  11. kyashwanthreddy

    kyashwanthreddy Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    hi,

    i increased post max size 64MB to 256MB. while i click submit it is taking lessdan 10 sec only...
     
    kyashwanthreddy, May 19, 2010 IP
  12. mfscripts

    mfscripts Banned

    Messages:
    319
    Likes Received:
    4
    Best Answers:
    8
    Trophy Points:
    90
    Digital Goods:
    3
    #12
    Are you're fieldnames definately unique, it's worth checking none are being named the same?

    Have you got a link to the app, it's easier to test if there's a demo or some source code?
     
    mfscripts, May 19, 2010 IP