We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Member id encrypt decrypt issue

Development and Programming

hbsinternet's avatar
hbsinternet
24 posts
9 years ago
hbsinternet's avatar hbsinternet

Hi All Members,

My requirement is, how we will encrypt {member_id} in template file without using any plugins.

Actually I have form with hidden values and I have tried with using php code in template file for encrypt member id.

<?php
 $supplier_id = ee()->encrypt->encode('{member_id}');
?>
<input type="hidden" name="supplier_id" id="supplier_id" value="<?php echo $supplier_id; ?>" />

But when we submit the form it goes to action modules function and it’s return the same value like {member_id} and code is below

$supplier_id = ee()->input->post('supplier_id', TRUE);
$supplier_id_decrypt = ee()->encrypt->decode($supplier_id); 

echo $supplier_id_decrypt;  //{member_id}

Please check and advise

       
Manuel Payano's avatar
Manuel Payano
144 posts
9 years ago
Manuel Payano's avatar Manuel Payano

I think your php code is running before any variables are parsed.

Try setting your “PHP Parsing Stage” to “Output” in the template settings.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.