How do you define a constant in php

Assignment Help PHP Web Programming
Reference no: EM133565

QUESTION 1

(a) Describe how the Web database architecture operates while accessing a PHP script. Illustrate your answer using a diagram.

(b) What is the difference between $message and $message?

(c) Explain each of the following string functions. Illustrate your answer with an example.

(i) strrev()

(ii) explode()

(iii) stristr()

(d) Write a PHP script to read a positive integer, n, from an input text box with the name "txtnum" and to calculate and print the value of 1 + 2 + ... + n.

QUESTION 2

(a) How do you define a constant in PHP?

(b) List the different types of errors in PHP.

(c) Exceptions are used to change the normal flow of a script if a specified error occurs. Describe how the Try, Throw and Catch statements are used to handle an exception.

(d) Outline the differences between mysql_fetch_object() and mysql_fetch_row().

(e) Write PHP script that allows you to fetch information entered in the two text box fields namely: txtStudent for student's name and txtClass for class name and finally appends the information into the file student.dat Your program must also respond by printing a welcome message as follows:

Welcome, x where x is the student name.

QUESTION 3

(a) Show how you can achieve the following in PHP:

(i) a page reloading itself

(ii) causes a web page redirection.

(b) Describe any two different types of arrays as used in PHP programming.

(c) Give two methods that might be used to control sessions in a web based application. Explain the shortcomings of each method.

(d) Write extract codes to demonstrate how PHP allows you to:

(i) create a Session

(ii) retrieve a Session value

(iii) delete a Session.

QUESTION 4

(a) List four benefits while using a relational database such as MySql.

(b) Consider a server with the following settings:
servername: localhost
username: donald
password: jerry
How does PHP allow you to open a connection to a MySQL database, ensuring that the script returns appropriate error message.

(c) Referring to Question 4(b), list the PHP statements that allows you to

(i) create the database named VideoClubDB

(ii) create the database table tblMovie

(iii) add the three fields: MovieName, MovieDirector and MovieType

(d) Referring to Question 4(b) and 4(c), write extract codes to display all the records from the tblMovie table and the results sorted by the MovieName column

Reference no: EM133565

Questions Cloud

Essential business deductions : Essential business deductions in each of the subsequent situations.
The concept of sustainable leadership : The concept of sustainable leadership
Evaluate taxable income and the income tax liability : Evaluate taxable income and the income tax liability (before credits or prepayments) on a joint return
Porter''s five forces analysis : PEST analysis, Porter's FIVE forces analysis, Porter's model
How do you define a constant in php : How do you define a constant in PHP. List the different types of errors in PHP.
Essentially analyse the position of the leader : Essentially analyse the position of the leader
Prepare bank reconciliation for donovan company : Prepare bank reconciliation for Donovan Company for September which reconciles the balance per books and the balance per bank to their adjusted accurate balances.
Elaborate on leadership style : Elaborate on leadership style
Using the cost model evaluate the amount : Using the cost model, at what amount could the land be reported in the statement of financial position of Jeng Ting Ltd for each reporting date? Describe your answers.

Reviews

Write a Review

PHP Web Programming Questions & Answers

  Online banking application

Designing and developing a web applications The company you are working has secured a contract with a local banking group to develop an ONLINE BANKING APPLICATION using PHP and MySQL.

  Implement a web application

Implement a web application called CS320Starter, which is similar to the crowd funding platform Kickstarter where people raise funds for their projects.

  Design a dynamic database

Design a dynamic database using Mangodb, html , and php.

  Web application development

Create a simple Web Application that collects gradings under a number of criteria, and then calculates an aggregate mark

  Encryption and hashing

securing a new web server and a new web application, input validation, CSRF attack, SQL injection vulnerability, Cross Site Scripting (XSS) attack, architecture mechanism Linux, Apache, MySQL, and PHP,

  Which of the following jsp expressions is valid

A JSP expression can contain any Java expression that evaluates to a String object, Java object, primitive type, primitive type or Java object

  Prepare an ajax enabled web form

Prepare an AJAX enabled web form utilising a ListView control that will allow logged-in staff to list, edit, delete, insert magazine details for magazines from a selected magazine category.

  Model view controller pattern

PHP Frameworks, class patterns and object patterns, Object Oriented Design Principles, Program to an ‘interface' not to an Implementation, Open Close Principle, Principle of Least Knowledge, creational design prototypes, Dependency Inversion principl..

  Shopping cart program for web applications class

Shopping Cart program for web applications class. Allows user to browse while keeping track of the items in which they will purchase at the end on the order page link and this will give a final price for all items.

  Create a web site for an apple farm

Create a web site for an apple farm. Create an HTML5 form allowing visitors to create an account with the site. Account details are to be stored in your MySQL database. Information should be stored in a secure way.

  Create a very simple order system as a web application

Create a very simple Order System as a web application.

  Sample website project

This website consists of three sections: a narrative, a storyboard, and a business Website.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd