How to check if any fields in a form are empty in php


This question already has an answer here:


your form is missing the method...

<form name="registrationform" action="register.php" method="post"> //here

anywyas to check the posted data u can use isset()..

Determine if a variable is set and is not NULL

if(!isset($firstname) || trim($firstname) == '')
   echo "You did not fill out the required fields.";

Specify POST method in form
<form name="registrationform" action="register.php" method="post">

your form code


Need Your Help

Simple If/Else Razor Syntax

c# razor html-table

I'm trying to do a simple If/Else within a foreach with this code:

Symfony Propel Project: How to upgrade schema without database resets?

php symfony1 propel

I've deployed my symfony project to the server and now I wanna change the models inside schema.yml without reseting other unrelated database tables and keep the current data.