0

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}

1 Answer 1

4

Do you have PHP Parsing Stage on "Input"?

<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 ee()->input->post('uid', TRUE); ?>"}
  <p>{email}</p>
{/exp:member:custom_profile_data}
2
  • I have updated the question as i have added XID for EE requirements. I have tried what you have written but it does not return anything but gives no error.
    – Derple
    May 9, 2015 at 18:02
  • And changed the parsing stage to input and works now thankyou!
    – Derple
    May 9, 2015 at 18:11

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.