Create a profile input form

Now let's create the HTML form for users to enter their profile data.

Our profiles app would be no use if we didn't have a simple way for a user to enter their user profile details.

We'll create the profile input form like this:

//create_profile.php 
 
<html> 
<body> 
<form action="post_profile.php" method="POST"> 
 
  <label>Name</label><input name="name"> 
  <label>Age</label><input name="age"> 
  <label>Country</label><input name="country"> 
 
</form> 
</body> 
</html> 

In this profile post, we'll need to create a PHP script to take care of anything the user posts. It will create an SQL statement from the input values and output whether or not they were inserted.

We can use the null coalesce operator again to verify that the user has inputted ...

Get PHP 7 Programming Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.