SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jun 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post $_POST cant fetch information

    Can anyone tell me if there is any error in the code. Because I think that $ _POST is not properly defined, because it didn't skips the first IF even when there is some value

    PHP Code:
    for($i=1$i<=15$i++) {
    $hbs "other_text".$i;

    if(
    $_POST['other_text'.$i]]=="") { 
    echo 
    "You didn't eneter quantity"
    die(); 
    }

    if(!
    is_int($_POST['other_text'.$i]) || isset($_POST['vin'.$i])) {
    $vins .= '<tr><td>'.$_POS['vin_lbl'.$i].'</td><td…
    }
    else {
    echo "Incorrect data for quantity. \n Please go back.";
    }

    Now show me that Undefined index: other_text1 so i checked the form in html and this is the code of the textbox
    HTML Code:
    <input type="text" value="1" disabled name="other_text1" style="width:15px; padding:1px; height:10px; font-size:9px; background-color:#FFF; box-shadow:none; ">
    and this is my declaration of the form
    HTML Code:
    <form name="f1" action="env.php" method="post">

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,806
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Hi dredash and welcome to SitePoint.

    If you dump out the POST array and see what is populated and with what values.
    Add the following snippet to just above the code you posted:
    PHP Code:
    echo '<pre>';
    print_r($_POST);
    echo 
    '</pre>'
    This will give you a formatted array of values being sent through from the form.
    Check the field names, values etc
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Member
    Join Date
    Jun 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I realized why $_POST not get value because by default text box is disabled, but how to do it


Bookmarks

Posting Permissions

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