I have created some access controlled pages which can be viewed only after logged in. I had to create another page which holds a form where the user is going to fill the details and submit it. But am not able to connect page A to page B so that the user is still logged in.
I try to add the codes that I used in the access controlled pages to the Page B which has a form. But then the page shows internal error 500.
The code that I am using on the access controlled pages is
<?PHP
require_once("./include/membersite_config.php");
if(!$fgmembersite->CheckLogin())
{
$fgmembersite->RedirectToURL("login.php");
exit;
}
?>
When I try to use the same for the Page B which has a form for submission, it doesn't work.
Something is conflicting.
Here is the code on the Page B
<?PHP
require_once("./separate/include/fgcontactformuser.php");
require_once("./separate/include/captcha-creator.php");
$formproc = new FGContactForm();
$captcha = new FGCaptchaCreator('scaptcha');
$formproc->EnableCaptcha($captcha);
$formproc->AddRecipient('mail.com'); //<<---Put your email address here
$formproc->SetFormRandomKey('H04uLRJh4CY5sR4');
if(isset($_POST['submitted']))
{
if($formproc->ProcessForm())
{
$formproc->RedirectToURL("PageB.php");
}
}
?>
Why is there a conflict and why it doesn't work?