Re: should I be looking to eliminate all notices?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, April 23, 2007 2:56 pm, Justin Frim wrote:
> Now that's a stupid example, but, you get the idea.

Well, we agree that it's a stupid example...
:-) :-) :-)

<?php
$formfield = isset($_GET['formfield']) ? $_GET['formfield'] : '';

// VALIDATE $formfield here!!!
// be as strict as you can possibly be!!

$funcresults = myfunction($formfield);

function myfunction($formfield){
  global $myarray; //ugh!
  echo "foo";
  if (isset($myarray[$formfield])) return $myarray[$formfield];
  return false;
}

function yourfunction($formfield){
  global $yourarray; //ugh!
  echo "bar";
  $sub = subfunction($formfield);
  if (isset($yourarray[$sub])) return $yourarray[$formfield];
  return false;
}

//I dunno what you expect subfunction to be, as you never defined it...

I think I got all your code in, though it's hard to tell with the
mish-mash you made of it with comments...

And I don't really understand at all what you thought was going on,
but your comments and the code you wrote didn't seem to match up to
me...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux