sabret00the
03-24-2005, 08:20 AM
what's wrong with this conditional i thought i was being quite creative?
$og_personal_message = "Please Enter A Personal Message The Group Description and Group Title Will Be Automatically Included.";
$og_personal_message = trim($og_personal_message);
$personal_message = trim($personal_message);
if ((strstr($personal_message, $og_personal_message)) AND (strlen($personal_message) != strlen($og_personal_message)))
{
$include_message = TRUE;
}
it basically checks the default value of a textarea and if it's the same when the form is being processed ignores it, where as if it's been edited whether completely different or just had something added to it it will include it in it's DB actions, the strlen comparison works to perfection, however STRSTR() is a whole over matter :( i'm not sure if it's me trying to use the wrong function or just bad coding?
oh and i read php.net before i came here too :)
$og_personal_message = "Please Enter A Personal Message The Group Description and Group Title Will Be Automatically Included.";
$og_personal_message = trim($og_personal_message);
$personal_message = trim($personal_message);
if ((strstr($personal_message, $og_personal_message)) AND (strlen($personal_message) != strlen($og_personal_message)))
{
$include_message = TRUE;
}
it basically checks the default value of a textarea and if it's the same when the form is being processed ignores it, where as if it's been edited whether completely different or just had something added to it it will include it in it's DB actions, the strlen comparison works to perfection, however STRSTR() is a whole over matter :( i'm not sure if it's me trying to use the wrong function or just bad coding?
oh and i read php.net before i came here too :)