[FX.php List] PHP error help
Bob Patin
bob at patin.com
Mon Jun 30 14:15:33 MDT 2008
On Jun 30, 2008, at 3:04 PM, CSInfo wrote:
> FYI:
> The line:
> $createResult=$create=>FMFindAll();
> should be:
> $createResult=$create->FMFindAll();
>
I'm not surprised, I was typing quickly!
>
> I got my query to work, now I am getting an error when I submit
> fields from the HTML from as POST that are empty? (resulting in no
> POST) How do I ignore those?
One way is to test for empty POSTs like this:
if (strlen($_POST['myVariable']>0){
$myVariable = $_POST['myVariable'];
}
When I require fields to not be empty, I string together a bunch of
these, like this:
if ((strlen($_POST['myVariable']<1) or
(strlen($_POST['myVariable2']<1) or (strlen($_POST['myVariable3']<1)){
echo 'One or more required fields was not provided.<a
href="javascript:history.back();">CLICK HERE</a> to return to the
previous page.';
exit;
}
Note that I use single-quotes around the ECHO line so that I can use
double-quotes in the HREF.
This will put up a simple warning, with a link so they can go back to
the form without retyping everything; yes, I know it's the same as the
BACK button, but people like having it there.
Hope this helps,
Bob Patin
Longterm Solutions
bob at longtermsolutions.com
615-333-6858
http://www.longtermsolutions.com
FileMaker 9 Certified Developer
Member of FileMaker Business Alliance and FileMaker TechNet
INSTANT MESSAGING:
AIM or iChat: longterm1954
--------------------------
Contact us for FileMaker hosting and programming for all versions of
FileMaker
PHP • Full email services • Free DNS hosting • Colocation • Consulting
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20080630/7a550854/attachment.html
More information about the FX.php_List
mailing list