Home Forums General Issues Echo Form Field Values via $_POST


Echo Form Field Values via $_POST

  • Hey. I’m trying to create a preview of my front end form similar to this page.

    My issues is that the $_POST values for the ACF fields are returning NULL.

    The post title returns correctly but not the custom fields.


     echo "<p>Post Title:".$_POST["postTitle"]."</p>"; // This works
     echo "<p>Post Title:".$_POST["fields[field_51dbe34b78471]"]."</p>"; // This doesn't

    Any suggestions on what I am missing?

  • Hi @markkelly1982

    Always test data before asuming it exists.

    Test like this:

    echo '<pre>';
    echo '</pre>';
  • Hi.

    Yeah I had tried that and that’s where i got the NULL return from.

    Is there a function that I have to tie to my submit button to make the custom fields POST?

  • Perhaps the issue is the syntax error in your code.

    echo "<p>Post Title:".$_POST["fields[field_51dbe34b78471]"]."</p>"; // This doesn't

    should be

    echo "<p>Post Title:".$_POST["fields"]['field_51dbe34b78471']."</p>"; // This doesn't
Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Echo Form Field Values via $_POST’ is closed to new replies.