Using this form to post to itself is not working as expected.
But why?
<form method='POST' action='gen_req'>
<input id='input' name='uid' placeholder='uid' />
<button class='btn'>Go</button>
</form>
{exp:member:custom_profile_data member_id="<? echo $_POST['uid']; ?>"}
<p>{email}</p>
{/exp:member:custom_profile_data}
UPDATED
I have corrected to add the XID line and use the ee() for the post. But still not returning any data.
This is what i have updated to:
<form method='POST' action='test2'>
<input type="hidden" name="XID" value="{XID_HASH}" />
<input id='input' name='uid' placeholder='uid' />
<button class='btn'>Go</button>
</form>
{exp:member:custom_profile_data member_id="<? echo ee()->input->post('uid', TRUE); ?>"}
<p>{email}</p>
{/exp:member:custom_profile_data}