Cairo University CMPN 425 PHP 2 Three-Tier Architectures Quiz
15 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

In PHP, what happens if the include statement fails to find the specified file?

  • The script continues but skips the included content
  • A warning is produced and the script continues (correct)
  • The script continues without any notification
  • A fatal error is produced and the script stops
  • How does including files save work in PHP?

  • By allowing standard content to be shared across multiple pages (correct)
  • By creating a new file from the included file
  • By stopping the script if the included file is missing
  • By generating a fatal error if the included file is missing
  • What is the purpose of using the include() function in PHP?

  • To stop the script if the included file is missing
  • To import the content of one PHP file into another PHP file (correct)
  • To produce a fatal error if the included file is missing
  • To create a new PHP file from the included file
  • What happens when the require statement fails to find the specified file in PHP?

    <p>A fatal error is produced and the script stops</p> Signup and view all the answers

    What kind of error does the require statement produce upon failure in PHP?

    <p>E_COMPILE_ERROR</p> Signup and view all the answers

    In PHP, which function is used to include a standard menu file on all pages of a website?

    <p>require()</p> Signup and view all the answers

    What is the purpose of using the setcookie() function in PHP?

    <p>To create and retrieve cookie values</p> Signup and view all the answers

    Which function is used to show all the session variable values for a user session in PHP?

    <p>print_r()</p> Signup and view all the answers

    What does the feof() function do in PHP file handling?

    <p>Checks if 'end-of-file' (EOF) has been reached</p> Signup and view all the answers

    Which function is used to read a single line from a file in PHP?

    <p>fgets()</p> Signup and view all the answers

    What is the purpose of the setcookie() function parameters in PHP?

    <p>To create and retrieve cookie values</p> Signup and view all the answers

    Which function is used to destroy the session in PHP?

    <p>session_destroy()</p> Signup and view all the answers

    What does the fopen() function return if it is unable to open the specified file?

    <p>'False'</p> Signup and view all the answers

    In PHP, which function checks if the 'end-of-file' (EOF) has been reached?

    <p>'feof($file)'</p> Signup and view all the answers

    What does the fgetc() function do in PHP file handling?

    <p>Reads a single character from a file</p> Signup and view all the answers

    Use Quizgecko on...
    Browser
    Browser