can I add a php block to 'Main'?

Permalink
Hi, say I add a page to my concret5 website. And, I edit the page and click on Add to Main. I have the choices of adding forms, content, html, etc. However, I want to add php. How can I do this?

I created a form and I'm going to pass session information to other pages. This is why I need to know how.

Please help.

 
jgarcia replied on at Permalink Best Answer Reply
jgarcia
hubside replied on at Permalink Reply
Thank you. I just installed it, but am having problems.

I have an html form whom's action=register.php

When you click submit on the html form submit button, register.php is executed. It starts a session like this:
session_start();

Then it creates some sessions variables like this:
$_SESSION['first_name']=$_POST['first_name'];

when that is done, I redirect the user to another page. This last page is where I have the php block in use. So, I edited the page and added the PHP block. Within my php block I tried this:
session_start();
echo "Thank you for registering," . $_SESSION['first_name'];

But, when I register and am redirected to this page, it only displays this on the page: Thank you for registering,

Seems like sessions aren't being passed. I tested this outside of concrete5, just though a basic apache2 site and it works fine.

=\ confused