Write a php script that says welcome back to the user

Assignment Help PHP Web Programming
Reference no: EM13896375

1. Write a script that prints out the following text to the screen exactly as shown:

"Hey", he said, "You still owe me \‘$5'\ from \\\ that $50 I lent "last week"".

2. Write a script that uses a loop to write the values 1 to 1000, one value per line. Inside the loop skip printing number 250, and determine if the next number to be written is 500. If it is, stop the loop.

3. Write a PHP script that uses an array called $array to store the values of firstname and lastname that are sent by the following form.

<form action = "./lesson3.php" method = "get">
First name: <input type = "text" name = "firstname">
Last name: <input type = "text" name = "lastname">
<input type = "submit">
</form>

Write the code to add those values from the form to the end of the $array array. Then use a foreach loop to print out the values from $array.

4. Write a PHP script that opens a text file called "lesson04.txt" for appending (or creates it if it does not yet exist); if there is a problem opening/creating the file, terminate the PHP script. Write the text "\nCOMP2920 will be fun\n" to the text file, and close the file.

5. Write a regular expression that matches only the following:

A street address that has the following pattern (in the following order):

An optional # sign                                                                                   e.g. "#"

1 to 5 digits (optional - apartment number)                                               e.g. "100"

an optional dash, which has an optional space on either side of it                e.g. " - "

1 to 5 digits (street number)                                                                    e.g. "7777"

"th" or "st" or "nd" or "rd" (optional)                                                         e.g. "th"

At least one space                                                                                  e.g. " "

"Street" or "street" or "Avenue" or "avenue" or "Ave" or "ave"                   e.g. "Street"

Examples that meet the criteria:
"#100 - 7777th Street"
"100-7777 ave"

Examples that do not meet the criteria:
"abc100 - 7777 ave"
"100-7777 ave XYZ"

$regex = "

6. Write a PHP script that says "Welcome back" to the user if they have visited the site in the past 10 minutes. If the user has NOT visited in the past 10 minutes, tell them "Welcome to my Web site" and store a cookie that will remember them for 10 minutes. Use a cookie called "tenminutes".

7. Write a script that checks for the existence of a session variable called "lastname". If the variable does not exist, tell the user "farewell" and terminate the script. If the variable does exist, print its value to the screen and create a session variable called "logged", and set its value to true. Write all of the code necessary to make the script work.

8. It is not easy to test graphics without using a reference guide. Instead, describe your favourite and least favourite parts of this course. Any thoughtful reply will earn top marks. Incomplete or unhelpful comments can earn zero marks.

9. I have created a database account on a host called "blah.com". You can connect to the host with username "tony" and password "comp1920".

The database is called "information". There is a table in this database called "names" with the following fields:
- firstname varchar(40)
- lastname varchar(40)
- middlename varchar(40)
- nickname varchar(40)
- username varchar(40)

Write a PHP script that connects to the database server, or dies if it cannot connect. Select the "information" database. Insert a record into the database.

10. Continuing from question 9 (do not repeat that code here), write a script to list all of the records in the "names" table of the "information" database, sorted by nickname.

11. Your instructor likes to learn new things, too.

What is the meaning of life? Tell your instructor anything that makes him *think*. Any attempt at an honest answer will score full marks. Your instructor has learned lots of interesting things from students.

Reference no: EM13896375

Questions Cloud

What maximum height can the glass : A 25 cm tall glass of 12 cm diameter and weighing 2.0 N is pushed on at a height h above the table. If the coefficient of frictionμ_k= 0.30 between the glass and table,at what maximum height h can the glass be pushed if it is not to tip over?
Discuss nature of political competition : Discuss nature of political competition between party and presidential candidates
Determine the number of production lines pennys should have : Penny's Pies is a small specialty supplier to a national coffee-house chain. Based on the information provided in the table, determine the number of production lines Penny's should have.
How come in free fall feel weightless : How come in free fall you feel weightless even though gravity is pulling down on you?
Write a php script that says welcome back to the user : Write a PHP script that says "Welcome back" to the user if they have visited the site in the past 10 minutes. If the user has NOT visited in the past 10 minutes, tell them "Welcome to my Web site" and store a cookie that will remember them for 10 ..
The collision is perfectly elastic : 1. A ball of mass 0.544 kg is moving east with a speed of 3.90 m/s and collides head-on with a 0.272 kg ball at rest. Assume that the collision is perfectly elastic. After the collision, the 0.544 kg ball moves at 1.3 m/s.  What is the speed of the 0..
Explain the development of executive power : Explain the development of executive power
A brick is initially 11.96 cm high : A brick is initially 11.96 cm high and an aluminum can is initially 11.97 cm high. By how much must their temperatures be raised in order for the brick and the can to have exactly the same height?
Which food provides the greater energy per serving : One food product has an energy content of 170 kcal per serving, and another has 280 kJ per serving. Which food provides the greater energy per serving?

Reviews

Write a Review

PHP Web Programming Questions & Answers

  Random integral numbers based on normal distribution

Prepare a system to generate random integral numbers based on normal distribution. Study Data Generator's structure and extend number generation type to activate normal distribution.

  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.

  Develop a dynamic website open university

Develop a dynamic website Open University

  Sample website project

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

  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.

  Design a dynamic database

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

  Show the accessibility and usability of website

The webpage must have several menus about country Azerbaijan such as "About Azerbaijan" "History" "Geography" "Landscape" and "Accessibility" menu.

  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.

  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.

  Create a very simple order system as a web application

Create a very simple Order System as a web application.

  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

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