I'm trying to check if a field is empty when a form gets submitted. If it is, I want to stop the rest of the file processing and output an error message. What I have so far is:
Code: Select all
<?php
import_request_variables('p', 'p_');
// if no title is entered, abort
if ($p_SectionName = "")
die("You must enter a Section Title.\nPlease go back and add a title");
?>What am I doing wrong? Is die() not the function to be using here? Is my method of checking the form field wrong? Am I completely barking up the wrong tree?
Any help would be greatly appreciated.
Cheers,
Seona.