Re: [PHP] How do I convert from perl to php? - Reality Check & Taxation
Ok, Let's concentrate on acceptable syntaxes for your html programmers to specify the required fields first. Here are some options grouped by technique and roughly put into order of increasing difficulty for an html author: HTML 1. PHP FUNCTION 2. required(name,phone,address); 3. required($name,$phone,$address); PHP ASSIGNMENT -- 4. $required = 'name address phone'; 5. $required = 'name,address,phone'; 6. $required = array($name,$address,$phone); COMPLETE INLINE PHP CODE 7. Rasmums solution (slightly modified): if (!(1==1 && isset($name) && isset($address) && isset($phone) )){print 'You left one empty.';} It's really up to you to say which of these is most acceptable to your html guys. The order also roughly corresponds to decreasing amounts of php code and support required. Here's the supporting code for each: 1. --- foreach(explode(' ',$required)) as $field) { if (${$field) == '') { print 'You left one empty.'; break; } } 2. required(name,phone,address); function required() { foreach(func_get_args() as $field) { global ${$field}; if (${$field} == '') { print 'You left one empty.'; return; } } } 3. required($name,$phone,$address); --- function required() { foreach(func_get_args() as $field) { if ($field == '') { print 'You left one empty.'; return; } } } 4. $required = 'name address phone'; foreach(explode(' ',$required) as $field) { if (${$field} == '') { print 'You left one empty.'; break; } } 5. $required = 'name,address,phone'; foreach(explode(',',$required) as $field) { if (${$field} == '') { print 'You left one empty.'; break; } } 6. $required = array($name $address $phone); foreach(explode(' ',$required) as $field) { if (${$field} == '') { print 'You left one empty.'; return; } } 7. Rasmus Solution -- Already complete! The closest to your original is 4., and it is pretty close. However, if your html guys are really so allergic to code I would have thought that 1. would suit them best. The great benefit of 7., is that your html guys would learn something useful that they could apply elsewhere rather than a special "rule" on where to put required fields when they're working with you on a particular kind of job. For the record I typically have a completely different approach to the whole problem i.e. A. I would have field-specific (onChange) and form-wide (onSubmit) Javascript validation on the form page itself as a courtesy to the browser users and to save them unnecessary page loads. B. In the php, the checks would be repeated explicitly for users without Javascript or non-browser users and would include an unique identifier so that the form could be intelligently driven remotely by another application e.g. if ($name == '') { $errormessage .= "error:myform:0100 name is a required field."; } if ($address == '') if ($errormessage != '') { print 'Please correct the following errors -'.$errormessage; etc. C. The data would almost certainly have ended up in a database even if it is being mailed on or whatever. So the question of non-programming html designers adding required fields would not arise. I can't think of much data that I might trouble a user to enter that isn't worth explicitly storing. But then I guess we work on different kinds of applications. It sounds like you can't afford more than a couple of minutes per form while I have the luxury of half an hour or so. Good luck, George Brandon Lamb wrote: > > The point of keeping it easier is what if i want to give my script to a > friend, do you REALLY want to explain to a non-programmer how to add another > if statement or condition when they could simply add the field to the array? > > And actually you only have to change the name in 2 places. > 1. you 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 conver
Re: [PHP] How do I convert from perl to php? - Reality Check & Taxation
Ok, To summarise your requirements: 1. No javascript validation (users must reload for any validation). 2. No information on which field is missing. 3. Same message on all forms in all cases. 4. Simplest possible syntax for html designers who set the required fields. Possible syntaxes: a) Set hidden required field on form e.g. b) Set variable in php e.g. $required = 'name address phone'; $required = 'name,address,phone'; $required = array($name,$address,$phone); c) Call function in php e.g. required('name address phone'); required('name,address,phone'); required($name,$address,$phone); $required = 'a b'; $required = 'a,b'; $required = array($a,$b); $required = a b ; //required(a b); required(a,b); ho handles the Javascript on-page validation? Or do you always force your users to wait for a page reload before telling them about simple errors? The Javascript is Brandon Lamb wrote: > > The point of keeping it easier is what if i want to give my script to a > friend, do you REALLY want to explain to a non-programmer how to add another > if statement or condition when they could simply add the field to the array? > > And actually you only have to change the name in 2 places. > 1. you 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 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 problems! > > The parts of our code which are essential to the describe the real world > problem we want solved are > essential. All the rest of our code is an unfortunate "tax" on the rest of > the world. The code can > be as complex, dynamic, interesting or clever as it likes, it's still tax! > "Very dynamic script"s > have to be JUSTIFIED, they are not, repeat not, intrinsically good! > > In this case, the essential elements are the names of the fields required > and the message to be sent > if they are not present i.e. the following 38 characters > > "name address phone You left one empty." > > Rasmus code consists of 92 characters i.e. 44 extra characters or around > 110% tax. Does that sound > a lot? Your original perl had 192 characters i.e. over 400% tax. > > What about maintainability/reusability? Lets look at the tax element of > some likely changes: > > 1. Change in the name of one of the required fields e.g. name should now be > lastname > Rasmus : 0% TAX: (You change "name" to "lastname" once) > Perl : 200% TAX: (You change "name" to "lastname" in 3 places) > > 2. Remove one of the fields from the required list > Rasmus : 12 characters TAX (You have to remove "&& isset($) " as well as the > field name itself) > Perl : 13 characters + 200% TAX (You must remove "$ = param($);\n" and the > field name 3 times) > > 3. Add a new field > As per 2. above. > > 4. Modify the conditions for the error message e.g. change to name and > either address or phone > required > Rasmus : 4 characters TAX (change && to "or" and add two brackets) i.e. > if(!(isset($name) && (isset($address) or isset($phone)) { > Perl : Rewrite requiredunknown cost! > > Well, I hope that resolves the question of which is the more world-friendly > code (i.e. more "tax" > efficient). > > Personally, and all views on simplicity, elegance and beauty of code are > subjective, I also find > Rasums php version much simpler and easier to understand. It involves far > fewer commands and is > therefore much more accessible to the novice programmer. It has much less > extraneous structure and > is clearly focussed on the task in hand. It can very easily be extended and > modified to provide > richer functionality. What more do we want? (Well personally, I'd rather he > used "and" instead of > "&&" and "not" instead of "!" and put the separate conditions on separate > lines and generally had > more white space ;). > > George > > P.S. Is this a characteristic example of the differenc
Re: [PHP] How do I convert from perl to php? - Reality Check & Taxation
The point of keeping it easier is what if i want to give my script to a friend, do you REALLY want to explain to a non-programmer how to add another if statement or condition when they could simply add the field to the array? And actually you only have to change the name in 2 places. 1. you 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 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 problems! The parts of our code which are essential to the describe the real world problem we want solved are essential. All the rest of our code is an unfortunate "tax" on the rest of the world. The code can be as complex, dynamic, interesting or clever as it likes, it's still tax! "Very dynamic script"s have to be JUSTIFIED, they are not, repeat not, intrinsically good! In this case, the essential elements are the names of the fields required and the message to be sent if they are not present i.e. the following 38 characters "name address phone You left one empty." Rasmus code consists of 92 characters i.e. 44 extra characters or around 110% tax. Does that sound a lot? Your original perl had 192 characters i.e. over 400% tax. What about maintainability/reusability? Lets look at the tax element of some likely changes: 1. Change in the name of one of the required fields e.g. name should now be lastname Rasmus : 0% TAX: (You change "name" to "lastname" once) Perl : 200% TAX: (You change "name" to "lastname" in 3 places) 2. Remove one of the fields from the required list Rasmus : 12 characters TAX (You have to remove "&& isset($) " as well as the field name itself) Perl : 13 characters + 200% TAX (You must remove "$ = param($);\n" and the field name 3 times) 3. Add a new field As per 2. above. 4. Modify the conditions for the error message e.g. change to name and either address or phone required Rasmus : 4 characters TAX (change && to "or" and add two brackets) i.e. if(!(isset($name) && (isset($address) or isset($phone)) { Perl : Rewrite requiredunknown cost! Well, I hope that resolves the question of which is the more world-friendly code (i.e. more "tax" efficient). Personally, and all views on simplicity, elegance and beauty of code are subjective, I also find Rasums php version much simpler and easier to understand. It involves far fewer commands and is therefore much more accessible to the novice programmer. It has much less extraneous structure and is clearly focussed on the task in hand. It can very easily be extended and modified to provide richer functionality. What more do we want? (Well personally, I'd rather he used "and" instead of "&&" and "not" instead of "!" and put the separate conditions on separate lines and generally had more white space ;). George P.S. Is this a characteristic example of the difference beteeen Perl and PHP or an extreme example? Is Perl really so "geeky" in style and application? Or am I just too stupid, stubborn, ignorant to see that Perl is better than php? [EMAIL PROTECTED] wrote: > > 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."; > > } > > > > 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 = param(phone); > > > > > > @required = qw( name address phone ); > > > > > > foreach $key($required) > > > { > > > if (!$$key) { &out("You left one empty."); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
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 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 problems! The parts of our code which are essential to the describe the real world problem we want solved are essential. All the rest of our code is an unfortunate "tax" on the rest of the world. The code can be as complex, dynamic, interesting or clever as it likes, it's still tax! "Very dynamic script"s have to be JUSTIFIED, they are not, repeat not, intrinsically good! In this case, the essential elements are the names of the fields required and the message to be sent if they are not present i.e. the following 38 characters "name address phone You left one empty." Rasmus code consists of 92 characters i.e. 44 extra characters or around 110% tax. Does that sound a lot? Your original perl had 192 characters i.e. over 400% tax. What about maintainability/reusability? Lets look at the tax element of some likely changes: 1. Change in the name of one of the required fields e.g. name should now be lastname Rasmus : 0% TAX: (You change "name" to "lastname" once) Perl : 200% TAX: (You change "name" to "lastname" in 3 places) 2. Remove one of the fields from the required list Rasmus : 12 characters TAX (You have to remove "&& isset($) " as well as the field name itself) Perl : 13 characters + 200% TAX (You must remove "$ = param($);\n" and the field name 3 times) 3. Add a new field As per 2. above. 4. Modify the conditions for the error message e.g. change to name and either address or phone required Rasmus : 4 characters TAX (change && to "or" and add two brackets) i.e. if(!(isset($name) && (isset($address) or isset($phone)) { Perl : Rewrite requiredunknown cost! Well, I hope that resolves the question of which is the more world-friendly code (i.e. more "tax" efficient). Personally, and all views on simplicity, elegance and beauty of code are subjective, I also find Rasums php version much simpler and easier to understand. It involves far fewer commands and is therefore much more accessible to the novice programmer. It has much less extraneous structure and is clearly focussed on the task in hand. It can very easily be extended and modified to provide richer functionality. What more do we want? (Well personally, I'd rather he used "and" instead of "&&" and "not" instead of "!" and put the separate conditions on separate lines and generally had more white space ;). George P.S. Is this a characteristic example of the difference beteeen Perl and PHP or an extreme example? Is Perl really so "geeky" in style and application? Or am I just too stupid, stubborn, ignorant to see that Perl is better than php? [EMAIL PROTECTED] wrote: > > 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."; > > } > > > > 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 = param(phone); > > > > > > @required = qw( name address phone ); > > > > > > foreach $key($required) > > > { > > > if (!$$key) { &out("You left one empty."); } > > > } > > > > > > ?? > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How do I convert from perl to php?
Oops, I didn't mean to post the same code that's been posted. The subject sorter doesn't work correctly on Netscape Messenger. I thought I had finished reading the thread. My apologies, Robin Robin Chen wrote: > > > $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 message once. > > Robin > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How do I convert from perl to php?
You don't need to use the $has_empty variable, but I thought it would be better to just display the message once. Robin [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 = param(phone); > > @required = qw( name address phone ); > > foreach $key($required) > { > if (!$$key) { &out("You left one empty."); } > } > > ?? > > - > This message was sent using OlyPen's WebMail. > http://www.olypen.com > > The original message was received at Tue, 20 Nov 2001 14:05:28 -0800 > from mail.olypen.com [208.200.248.2] > >- The following addresses had permanent fatal errors - > <[EMAIL PROTECTED]> > (reason: 550 Host unknown) > >- Transcript of session follows - > 550 5.1.2 <[EMAIL PROTECTED]>... Host unknown (Name server: lists.php.ne: >host not found) > > > Reporting-MTA: dns; relay1.olypen.com > Received-From-MTA: DNS; mail.olypen.com > Arrival-Date: Tue, 20 Nov 2001 14:05:28 -0800 > > Final-Recipient: RFC822; [EMAIL PROTECTED] > Action: failed > Status: 5.1.2 > Remote-MTA: DNS; lists.php.ne > Diagnostic-Code: SMTP; 550 Host unknown > Last-Attempt-Date: Tue, 20 Nov 2001 14:05:28 -0800 > > > > Subject: Converting from being a perl user > Date: Tue, 20 Nov 2001 22:08:17 GMT > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > > 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."); } > } > > ?? > > - > This message was sent using OlyPen's WebMail. > http://www.olypen.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: Re: [PHP] How do I convert from perl to php?
How about like this: $required = array("field1","field2","field3"); for ($i=0;$i 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... > > > 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 = param(phone); > > > > > > @required = qw( name address phone ); > > > > > > foreach $key($required) > > > { > > > if (!$$key) { &out("You left one empty."); } > > > } > > > > > > ?? > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How do I convert from perl to php?
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; > > > > $name = param(name); > > $address = param(address); > > $phone = param(phone); > > > > @required = qw( name address phone ); > > > > foreach $key($required) > > { > > if (!$$key) { &out("You left one empty."); } > > } > > > > ?? > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How do I convert from perl to php?
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 "; } } if ($error) { echo $error; } That's one way to do it. Joshua Hoover > 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."); } > } > > ?? > > > - > This message was sent using OlyPen's WebMail. > http://www.olypen.com > > > The original message was received at Tue, 20 Nov 2001 14:05:28 -0800 > from mail.olypen.com [208.200.248.2] > >- The following addresses had permanent fatal errors - > <[EMAIL PROTECTED]> > (reason: 550 Host unknown) > >- Transcript of session follows - > 550 5.1.2 <[EMAIL PROTECTED]>... Host unknown (Name server: > lists.php.ne: host not found) > Reporting-MTA: dns; relay1.olypen.com > Received-From-MTA: DNS; mail.olypen.com > Arrival-Date: Tue, 20 Nov 2001 14:05:28 -0800 > > Final-Recipient: RFC822; [EMAIL PROTECTED] > Action: failed > Status: 5.1.2 > Remote-MTA: DNS; lists.php.ne > Diagnostic-Code: SMTP; 550 Host unknown > Last-Attempt-Date: Tue, 20 Nov 2001 14:05:28 -0800 > > From: [EMAIL PROTECTED] > Date: Tue Nov 20, 2001 05:08:17 PM US/Eastern > To: [EMAIL PROTECTED] > Subject: Converting from being a perl user > > > 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."); } > } > > ?? > > - > This message was sent using OlyPen's WebMail. > http://www.olypen.com > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
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... > 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 = param(phone); > > > > @required = qw( name address phone ); > > > > foreach $key($required) > > { > > if (!$$key) { &out("You left one empty."); } > > } > > > > ?? > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How do I convert from perl to php?
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 = param(phone); > > @required = qw( name address phone ); > > foreach $key($required) > { > if (!$$key) { &out("You left one empty."); } > } > > ?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] How do I convert from perl to php?
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."); } } ?? - This message was sent using OlyPen's WebMail. http://www.olypen.com The original message was received at Tue, 20 Nov 2001 14:05:28 -0800 from mail.olypen.com [208.200.248.2] - The following addresses had permanent fatal errors - <[EMAIL PROTECTED]> (reason: 550 Host unknown) - Transcript of session follows - 550 5.1.2 <[EMAIL PROTECTED]>... Host unknown (Name server: lists.php.ne: host not found) Reporting-MTA: dns; relay1.olypen.com Received-From-MTA: DNS; mail.olypen.com Arrival-Date: Tue, 20 Nov 2001 14:05:28 -0800 Final-Recipient: RFC822; [EMAIL PROTECTED] Action: failed Status: 5.1.2 Remote-MTA: DNS; lists.php.ne Diagnostic-Code: SMTP; 550 Host unknown Last-Attempt-Date: Tue, 20 Nov 2001 14:05:28 -0800 --- Begin Message --- 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."); } } ?? - This message was sent using OlyPen's WebMail. http://www.olypen.com --- End Message --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]