Display 'this' if field returns empty

I have a php website where users can sign up, I can set up custom fields in the sign up process

Say I have one custom field that allows the user to type in a game title.

When they fill that field out and click submit, their profile on the website is created,

What I want to do is code something that says if that field is “battlefield” then a battlefield icon will display next to it on their profile page,

but if the field returns back empty, I don’t want anything to show…

Is this possible, and where can I learn how to code this?

Devin,

This is a relatively simple task, lets assume…

  1. You have a custom field in HTML where the user types in the game title
  2. Then when the user clicks submit, you read that custom field in php with $HTTP_GET, then you store it in the database along with the other users profile information.
  3. In order to store it in the database, you need to add a column to the profile table to support this new field.
  4. Then on his profile page you will read the custom field from the database along with his other profile information and display it based on the returned value.
  5. To do this you will use an IF STATEMENT to check the value of the field and only show the ICON if it matches battlefield.

Those are the steps and each of those steps require specific knowledge that you have to work through - but it’s not hard - Since you already have a website most of it’s in place already. So you just have to add on to whatever is in place already to accommodate the extra data.

Sponsor our Newsletter | Privacy Policy | Terms of Service