Support

Account

Home Forums General Issues Echo Form Field Values via $_POST

Solving

Echo Form Field Values via $_POST

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

    http://www.picssel.com/playground/jquery/postPreview_05Jun13.html

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

    The post title returns correctly but not the custom fields.

    preview.php

    
    <?php
    
     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:

    
    <?php 
    
    echo '<pre>';
    	print_r($_POST);
    echo '</pre>';
    die;
    
    ?>
    
  • 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.