Create link in List view using encrypted ID
Permalink Browser Info Environment
Hopefully this is a simple question!!
I am trying to create a link within the Proforms List block that will pass the encrypted ProformsItemID through to a page that displays the form fields in a nice format for printing. Right now I can only seem to pass the unencrypted ID through.
The code above creates this link:http://www.mysite.com/99 rather thanhttp://www.mysite.com/Ghj7NNrmDwnnGKY5ZapOQ99yeJd3oehL0DI=...
How do I change the code above to call the $encryptedID that I can see in the display block's controller?
The reason I need to do this is when I pass an unencrypted ID through, the form fields won't show. They only show when I pass an encrypted ID through.
I am trying to create a link within the Proforms List block that will pass the encrypted ProformsItemID through to a page that displays the form fields in a nice format for printing. Right now I can only seem to pass the unencrypted ID through.
<a href="http://www.mysite.com/?entryID=<?php echo $noO->getProformsItemID() ?>">Link to page</a>
The code above creates this link:http://www.mysite.com/99 rather thanhttp://www.mysite.com/Ghj7NNrmDwnnGKY5ZapOQ99yeJd3oehL0DI=...
How do I change the code above to call the $encryptedID that I can see in the display block's controller?
The reason I need to do this is when I pass an unencrypted ID through, the form fields won't show. They only show when I pass an encrypted ID through.
Type: | Discussion |
---|---|
Status: | In Progress |
Excuse my ignorance (as usual, ha), but do i put those lines right at the top of my view.php file where all the helpers are loaded, etc?
I totally saw that code in the controller.php and stared at it for about 10 minutes but couldn't figure out how to leverage it!
I totally saw that code in the controller.php and stared at it for about 10 minutes but couldn't figure out how to leverage it!
I want to redeem myself slightly: I know that can't go up at the top, it has to go after you define $no0...but I'm still just not clear on where to put those lines. I'm playing around and failing.
should just go within the foreach loop.
ChadStrat
ChadStrat
OK I've got that...I think I'm almost there! but do I need to do something to the link itself?
I feel like I need to do something to
but everything I try isn't working.
<?php foreach($entries as $noO) { $action = View::url('/dashboard/proforms/search/edit/' . $noO->getProformsItemID()); $salt = preg_replace('/[^A-Za-z0-9\-]/', '1', Config::get('SECURITY_TOKEN_ENCRYPTION') ); $encryptedID = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($salt), $noO->getProformsItemID(), MCRYPT_MODE_CBC, md5(md5($salt)))); ?> <tr class="ccm-list-record <?php echo $striped?>"> <?php if($allow_edit || $allow_delete){ ?> <td class="ccm-<?php echo $searchType?>-list-cb" style="vertical-align: middle !important"> <a href="http://www.mysite.com/?entryID=<?php echo $noO->getProformsItemID() ?>">Print</a> </td>
I feel like I need to do something to
<?php echo $noO->getProformsItemID() ?>
<?php foreach($entries as $noO) { $action = View::url('/dashboard/proforms/search/edit/' . $noO->getProformsItemID()); $salt = preg_replace('/[^A-Za-z0-9\-]/', '1', Config::get('SECURITY_TOKEN_ENCRYPTION') ); $encryptedID = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($salt), $noO->getProformsItemID(), MCRYPT_MODE_CBC, md5(md5($salt)))); ?> <tr class="ccm-list-record <?php echo $striped?>"> <?php if($allow_edit || $allow_delete){ ?> <td class="ccm-<?php echo $searchType?>-list-cb" style="vertical-align: middle !important"> <a href="http://www.mysite.com/[[somepage_withform_here]]/?entryID=<?php echo $encryptedID; ?>">Print</a> </td> <?php } ?>
This will either make you laugh or roll your eyes, but I did try that immediately, but neglected to include that little semicolon after $encryptedID...why is it always the tiniest, stupidest things that trip me up???
In any case IT WORKS!!! I am feeling triumphant thanks to your kind assistance.
In any case IT WORKS!!! I am feeling triumphant thanks to your kind assistance.
Hi there,
This is an auto responder to let you know that your support ticket has been forwarded to our entire support team at RadiantWeb!
Support tickets are reviewed Mondays thru Fridays 9am to 9pm & Saturdays 9am to 12pm EST.
A support team member will be following up with you as soon as possible.
Thank for supporting RadiantWeb Products!
RadiantWeb Support
http://goradiantweb.com
This is an auto responder to let you know that your support ticket has been forwarded to our entire support team at RadiantWeb!
Support tickets are reviewed Mondays thru Fridays 9am to 9pm & Saturdays 9am to 12pm EST.
A support team member will be following up with you as soon as possible.
Thank for supporting RadiantWeb Products!
RadiantWeb Support
http://goradiantweb.com
you need to set up the id encrypt first:
ChadStrat