Re: [PHP] How do I convert from perl to php? - Reality Check Taxation

2001-11-22 Thread George Whiffen
. in the required fields array - Original Message - From: George Whiffen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 21, 2001 7:28 AM Subject: Re: [PHP] How do I convert from perl to php? - Reality Check Taxation So I would have to write a seperate if condition for each

Re: [PHP] How do I convert from perl to php? - Reality Check Taxation

2001-11-21 Thread George Whiffen
So I would have to write a seperate if condition for each form input field i wanted to require? that doesn't make for a very dynamic script... if(!(isset($name) isset($address) isset($phone)) { echo You left one empty.; } Reality Check: We write code to solve real world

Re: [PHP] How do I convert from perl to php? - Reality Check Taxation

2001-11-21 Thread Brandon Lamb
define the variable as an input from a form 2. in the required fields array - Original Message - From: George Whiffen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 21, 2001 7:28 AM Subject: Re: [PHP] How do I convert from perl to php? - Reality Check Taxation So I would

[PHP] How do I convert from perl to php?

2001-11-20 Thread digital1
I am a perl user trying to convert to php how would i turn this perl into php? use CGI; $name = param(name); $address = param(address); $phone = param(phone); @required = qw( name address phone ); foreach $key($required) { if (!$$key) { out(You left one empty.); } } ??

Re: [PHP] How do I convert from perl to php?

2001-11-20 Thread Rasmus Lerdorf
if(!(isset($name) isset($address) isset($phone)) { echo You left one empty.; } On Tue, 20 Nov 2001 [EMAIL PROTECTED] wrote: I am a perl user trying to convert to php how would i turn this perl into php? use CGI; $name = param(name); $address = param(address); $phone =

Re: [PHP] How do I convert from perl to php?

2001-11-20 Thread Joshua Hoover
Try something like this: while (list($name, $value) = each($HTTP_POST_VARS)) { if ((strlen($value) 1) ($name == name || $name == address || $name == phone)) { $error .= You left $name empty br; } } if ($error) { echo $error; } That's one way to do

Re: [PHP] How do I convert from perl to php?

2001-11-20 Thread Miles Thompson
Beauty! /mt At 02:08 PM 11/20/2001 -0800, Rasmus Lerdorf wrote: if(!(isset($name) isset($address) isset($phone)) { echo You left one empty.; } On Tue, 20 Nov 2001 [EMAIL PROTECTED] wrote: I am a perl user trying to convert to php how would i turn this perl into php? use CGI;

Re: Re: [PHP] How do I convert from perl to php?

2001-11-20 Thread PHP List
Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 20, 2001 2:21 PM Subject: Re: Re: [PHP] How do I convert from perl to php? So I would have to write a seperate if condition for each form input field i wanted to require? that doesn't make for a very dynamic script

Re: [PHP] How do I convert from perl to php?

2001-11-20 Thread Robin Chen
? $required = array('name','address','phone'); $has_empty = 0; foreach ($required as $var) { if (!is_set($$var)) $has_empty = 1; } if ($has_empty) print 'You left one empty.'; ? You don't need to use the $has_empty variable, but I thought it would be better to just display the