[liphp] explode problem

Bhulipongsanon, Pinyo [email protected]
Thu, 05 Jun 2003 10:47:19 -0400


You can check with javascript on the form page before it even get process
and send user nice alert box informing them about missing information.

If you want to do it with PHP then you can also try this:

foreach (array_keys($_POST) as $key ) {
  if ( trim($_POST[$key]) == "" ) {
    // set status as incomplete
  }
}

This will catch all $_POST values so you have to be careful (i.e., it will
send X,Y values)

Pinyo

-----Original Message-----
From: Venkatagiriyappa, Veena [mailto:[email protected]]
Sent: Thursday, June 05, 2003 10:33 AM
To: '[email protected]'
Subject: [liphp] explode problem


Hi,
I need to verify if all the data in a html form (user input) is complete or
not. If the data is incomplete, the status will have to be set as
incomplete. So, I have a variable which holds all the fields from the html
form. Later I use explode function and send it to a foreach loop to check
for the empty filed.
PHP:
<?php
$required =
"title,sample,sourceorganism,expressionsystem,molecularweight,sequence,signi
ficance,relevant,requirements,anomalousatom,biologicalhazard,hazards";

        $fields_required = explode(",", $required);

?>


but I see that the explode function doesn't take more than 10 fields.
I have disabled the register_globals in the php.ini for security reasons.
Then, what is the alternate way of checking the fields for completeness?
_______________________________________________
Liphp mailing list
[email protected]
https://www.liphp.org/mailman/listinfo/liphp