Sessions and Headers in Joomla. Topic is solved

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
GenOne

Sessions and Headers in Joomla.

Post by GenOne » Tue Jan 29, 2008 8:51 pm

Hi all,

I am converting a script that I wrote for a friend into a Joomla component for her new Joomla site  8)

The script in PHP uses header() redirects and also uses $_SESSION to carry data from page to page.

My problem: I don't have a dev environment so I can't just test to see how Joomla handles these. (Looonnnggg story).  I am also new to OOP . So I have some confusion..well a lot of confusion.  :-[

Anyway:

I would like to do this
$_SESSION['myVariable']=$_POST['sentValue'];

I need to add info from a form into a session variable to so that it's available throughout the script.
and also

if(!$testValue){
header('Location:compontentHomePageFile');
exit;
}
If a testfails I need to send the user back tot he form to fill out the info.

My question is: as these are written are they usable in the  Joomla 1.0X  environment? Or is there some sort of class (like the database class) that I need to call. If so what is it? Sorry I am lost in the docs.

Thanks for your patience and your help.

Gen

Noob Now :pop

Post Reply