Delete record and return with variables

j.crilly 15 Apr, 2012
Hi,

I have a CC page that works well except for the delete.

The page is loaded using variables &sid=???&cid=??? which are required.

Using {delete_record} delete the record as it is supposed to, but returns to the page without the variables which in my case redirects to the home page if the correct variables are not used.

Is this possible.

I have a form that will delete the record and return but I would prefer not to use it as it has potential to become abused. Might alter the form to prevent this........
GreyHead 21 Apr, 2012
Hi j.crilly,

I'm afraid that I really haven't go my head round the new CC yet :-( Don't have anything useful to suggest except that you could add the paramters to the user Session and check for them on re-load. But I don't know if you can do that in this version of CC.

Bob
j.crilly 21 Apr, 2012
Thanks for the reply,

Still using old CC at this stage but will try using a session.

Not fully confident on setting sessions yet.

Cheers
Jamie
GreyHead 22 Apr, 2012
Hi Jamie,

Sessions are pretty simple to start with. Save some data
<?php
$session = JFactory::getSession();
$session->set('some_var', $some_value);
?>

and get it back again later
<?php
$session = JFactory::getSession();
$some_value = $session->get('some_var');
?>
There are some more bells and whistles but bascially that's it.

I Googled this tutorial which has some more info.

Bob
j.crilly 22 Apr, 2012
Thanks for the reply Bob,

It was just the right information to make it work properly. Still some testing to do, but looks good and works thus far!

Cheers
Jamie
This topic is locked and no more replies can be posted.