1

I'm getting notices and warnings for this BMR Calculator PHP script, but I'm not sure whats causing them at all since these messages are only showing up in Firefox. Heres a screenshot

I added the php/html directly to my template file and turned php on for that file is that correct? Here is the php/html

4

1 回答 1

2

Your issue is with:

$gender    = $_REQUEST['gender'];
$met       = $_REQUEST['metric'];

They're not defined in the query string or the posted data.

You could resolve the issue with an isset check.

# If gender is not set, set it to male by default.
$gender = isset( $_REQUEST['gender'] ) ? $_REQUEST['gender'] : 'male'; 
于 2013-03-08T18:51:21.197 回答