CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions

 PHP Encrypt URL & Bootstrap Launch Modal Window With Session Var

Print topic Send  topic

Author Message

Posts: 640
Posted: 02/03/2015, 6:37 PM

The encryption here is more about looks than security.
It masks the true id of the iduser record, that's all it does.
You can however now user a session variable to update user records.

How To...

In your grid, add a hidden field attached to iduser field (example called "iduser")

In your grid Link Before Show:

// Comment userPage = your gridnamePage


$userpage = CCGetFromGet("userPage");
$key = "D1Be1056x93o5aM7";
$url = $user->iduser->GetValue();
$encrypted = CCEncryptString($url, $key);
$user->Link1->SetLink("users.php?iduser=" . $encrypted . "&userPage=" .$userpage);

In Page Before Initialize Event:

$key = "D1Be1056x93o5aM7";
$iduser = CCGetFromGet("iduser");
$iduser = CCDecryptString($iduser, $key);

Also, in grid I have an Add New link with parameters:


In Before Show Of Any Form On The Page:

Place a hidden field in a form example called "iduser" on the page (this is to launch the Bootstrap Modal Window using a session variable)

$iduser = CCGetSession("iduser");

This launches Bootstrap Modal (in your .html)

<script type="text/javascript">

function GetURLParameter(sParam){
var sPageURL =;
var sURLVariables = sPageURL.split('&');
for (var i = 0; i < sURLVariables.length; i++)
var sParameterName = sURLVariables.split('=');
if (sParameterName[0] == sParam)
{ return sParameterName[1];
var iduser = $('#userSearchiduser').val();

var newuser = GetURLParameter('newuser');

if((iduser > 0) || ( newuser == 1)) {



In the form that gets carried in the modal window have links with Expression parameters to close the modal window


Central Coast, NSW, Australia.

View profile  Send private message

Posts: 513
Posted: 02/03/2015, 8:32 PM

Further to the other forum question - Yes, CCSEncrypt() is fine there.

It makes it not-obvious what is being stored but if someone cracks it, it won't open the database if they change it.

CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
View profile  Send private message

Posts: 640
Posted: 02/03/2015, 10:12 PM

Central Coast, NSW, Australia.

View profile  Send private message

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.