PHP Forms


  1. To validate an email address, which flag is to be passed to the function filter_var()?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    FILTER_VALIDATE_EMAIL


  1. What will be the value of the variable $input in the following PHP code?
    <?php
    $input = "Ajit<td>Gupta</td>you are really<i>Handsome</i>!";
    $input = strip_tags($input,"<i></i>");
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    Italic tags <i></i> might be allowable, but table tags <td></td> could potentially wreak havoc on a page.



  1. Which function is used to remove all HTML tags from a string passed to a form?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    strip_tags()


  1. Which one of the following should not be used while sending passwords or other sensitive information?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Because the data is visible to everyone.



  1. Which variable is used to collect form data sent with both the GET and POST methods?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    $_REQUEST