Portfolio Php and Html Codes for 6 EX

The PHP script is only executed at the server end and the server then sends the result in form of HTML to the client where it is displayed in the browser. The form data is sent from the browser to the PHP script which then processes the data to perform some calculations and finally produce the result.In PHP, while is the keyword which loops through a block of code while a specified condition is true. In our case, this statement tells the compiler to loop through a block of code until the value in a variable day is not greater than 29. Please note that in PHP:This statement calls a function money_format that returns a string formatted as a currency string, following by a call to another function echo to simply display the result (return value from money_format).The loop is just a round circle with one runner. The runner has a start point and ends at the same start point after completing one lapse and keep repeats it for a number of time. This is just what the codes are doing in the above circle. For more information see the above table.The program that we will discuss in this chapter is actually an improvement of the same program that we have discussed in the previous chapter. The fundamental idea of this program is basically the same as of the previous program – to calculate and display the total sum of pennies by the end of the month. However, rather than following the hard-coded 30 days loop like in the previous program, this program allows the user to select the starting date and the month, hence, giving a user more control on the output of the program. Besides above, this program also displays the breakup of an amount from the starting day till the end of the selected month. Like the previous program, this program also starts from a penny and then keeps on doubling the number of pennies before adding a penny each day from the selected day till the last day of the selected month.