I’m trying to retrieve data user after register, generally, first name, last name and email. Using this function
add_action(‘user_registration_after_register_user_action’, ‘ur_get_form_fields’, 10, 3);
function ur_get_form_fields($form_data, $form_id, $user_id)
{
var_dump($form_data);
}
But when i’m trying to use $form_data, id or user_id variable it gives me an error “Unexpected token A in JSON at position 0”
Any ideas?
]]><?php /* Template Name: CustomPageT3 */ ?>
<?php get_header(); ?>
<div id=”primary” class=”content-area”>
<main id=”main” class=”site-main” role=”main”>
<?php
// Start the loop.
while ( have_posts() ) : the_post();
// Include the page content template.
get_template_part( ‘content’, ‘page’ );
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
// End the loop.
endwhile;
?>
<?php
$mydb= new wpdb(‘user’,’mypassword’,’database’,’host’);
$rows = $mydb->get_results(“select columnName from customers”);
foreach ($rows as $obj) {
echo $obj->columnName;
?>
<table border=”1″>
<tr>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
<th>Address</th>
</tr>
[hi_php]
global $wpdb;
$result = $wpdb->get_results ( “SELECT * FROM customers” );
foreach ( $result as $print ) {
?>
<tr>
<td><?php echo $print->name;?></td>
<td><?php echo $print->email;?></td>
<td><?php echo $print->phone;?></td>
<td><?php echo $print->address;?></td>
</tr>
<?php }
?>
[/hi_php]
</main><!– .site-main –>
</div><!– .content-area –>
<?php get_footer(); ?>
]]>