0

I have what will probably turn out to be major noob error. I have an array under $_POST that displays the following when I var_dump it:

array(4) { ["user"]=> array(2) { ["username"]=> string(9) "webmaster" ["email"]=> string(24) "[email protected]" } ["_wpnonce_add-user"]=> string(10) "d7ba190414" ["_wp_http_referer"]=> string(30) "/wp-admin/network/user-new.php" ["add-user"]=> string(8) "Add User" }

The part that I'm interested in is the ["username"]=> string(9) "webmaster"

But when I try to get it using a $_POST['username'], I get a Undefined index: username

It's gotta be right under my nose, could someone help me connect the dots?

Many thanks in advance for any attempts.

1 Answer 1

1

The username element you are trying to access is itself a member of an array called "user" You need to use $_POST['user']['username']

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.