Create a new php session and store the username in it

Assignment Help Computer Engineering
Reference no: EM132207630

Write a PHP script that, when first loaded, presents a simple HTML login form with just a username prompt, like below:

When the user enters a username, create a new PHP session and store the username in it. Ensure to sanitise the username input to remove any tags and special characters in it!

Once logged in, your script should show the user a page like this.

Hello user you are logged in.

The user's session should remain active and the above "logged in" page should be shown even if the user refreshes the page or resubmits the form, or closes and reopens the webpage.

When the user clicks the "Logout" button, their active session should be destroyed and they should be redirected to the original login form, allowing them to login again.

Reference no: EM132207630

Questions Cloud

Briefly describe how someone should deviate : Consider a trading network in which there are two buyers (B1 and B2), two sellers (S1 and S2), and two traders (T1 and T2). The sellers each have one unit.
Objectives between demand planning and inventory management. : Explain the difference and objectives between demand planning and inventory management. Incorporate examples of technology for each.
Write a procedure that accepts pointers to two arrays : Write a procedure that accepts pointers to two arrays of double words and the size of both arrays (The arrays are equal in length.).
Find current period saving for kirk and dirk : There are two individuals, Kirk and Dirk, who each live for two periods. Both individuals derive utility from consumption, and their utility functions.
Create a new php session and store the username in it : Create a new PHP session and store the username in it. Ensure to sanitise the username input to remove any tags and special characters in it!
This could be branding or re-branding and advertising : This could be branding or re-branding, advertising or other traditional promotion, social media activity, distribution strategy, etc.
Write a php script that tests an email address is correct : Write a php script that tests whether an email address is input correctly. Verify that the input begins with series of characters.
Why does conflict exist between departments at custom chip : Custom Chip, Inc. is a semiconductor manufacturer specializing in custom chips for use in radio frequency devices such as satellite transmitters.
The transportation service index : The Transportation Service Index (TSI) is a measure of only cargo's production process

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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