Form

Discussion in 'HTML & Website Design' started by ssimon171078, May 14, 2015.

  1. #1
    i created form i need that i can Add to number or Subtract user choose what to do (+ or -)
    how to correct form ,can i do this in end form with + or -:
    <div>
    <?php

    if(isset($_POST["userSelected"])){
    $nm = $_POST["userSelected"];
    //echo $nm ;
    if($nm != ""){
    $number = $user_pass[$nm];
    //echo $number;
    $txtErr = "<form action='$Iam' method='post'>";
    $txtErr .= "<p> Name <input name='nm' value='" . $nm . "'></p>";
    $txtErr .= "<p> Number <input name='num' value='" . $number . "'></p>";

    $txtErr .= "<p><input type='submit' value='Submit' name='Submit'></p></form>";
    } else {
    $txtErr = "choose name";
    }
    }
    ?>
    </div>
     
    ssimon171078, May 14, 2015 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #2
    Your question makes no sense, your code is a laundry list of how NOT to write php including a bit of "security, what's that"...

    Could you better explain what you are trying to accomplish and what form your post data is coming from?
     
    deathshadow, May 14, 2015 IP