Hi,
Am I correct to assume that I cannot use both SQLCRUD and a 'Protect page' extension on the same page without amending the system generated code? I have created a database to be accessed by a small number of members, and I'm using an embedded database to control access. I have a separate login page that directs these members to the database input screens, but when I put a 'Protect page' extension onto the same page as an SQLCRUD extension, I get the system generated message:
"Notice: session_start(): Ignoring session_start() because a session is already active (started from /homepages/34/d472519093/htdocs/cawos/testform/Projects.php on line 7)....."
I've done some coding in the past (not php!), and I'm happy to learn to amend the code to prevent a new session being created when a user goes to one of the database input screens, but I don't want to do this if there's a simpler answer, or if amending the code is unlikely to work.
Regards,
Geraint
SQLCRUD and login using embedded database
Forum rules
IMPORTANT NOTE!!
DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.
PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
IMPORTANT NOTE!!
DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.
PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
- wwonderfull
-
- Posts: 1556
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: SQLCRUD and login using embedded database
That error generally refers when for example you have 2 php codes where on both code session_start(): has been used so server tries to ignore the duplication as it already started. Maybe you can go to the converted form and remove it, or you can also remove it after the files are published and then try.
Re: SQLCRUD and login using embedded database
This is a NOTICE error which indicates a minor error in PHP that does not halt script execution.
You can suppress this by adding the following code at the start of the page.
Use the Page HTML option then add it to the Start of Page section.
<?php
error_reporting(E_ALL & ~E_NOTICE);
?>
You can suppress this by adding the following code at the start of the page.
Use the Page HTML option then add it to the Start of Page section.
<?php
error_reporting(E_ALL & ~E_NOTICE);
?>
Re: SQLCRUD and login using embedded database
The extension generates its own code so it's not aware of other code on the page.
Therefor it may cause conflicts with other scripts.
As a workaround this may work:
Site Properties -> User Defined Variables -> Add
Name:
Value:
Therefor it may cause conflicts with other scripts.
As a workaround this may work:
Site Properties -> User Defined Variables -> Add
Name:
Code: Select all
session_start();
Code: Select all
if (session_id() == "") session_start();
Re: SQLCRUD and login using embedded database
Thanks for the suggestions, I went with WWbman and added the code to turn off NOTICES. It didn't work, but I assume that's because the auto-generated code (shown below) that I didn't include in my original post has a line that presumably overrides it by setting error_reporting to E_ALL. I don't expect people to teach me php coding, but I assume that I can just remove this line, or amend it on the server to make the '~E_NOTICE' 'change suggested by WWbman. I will have to do this for several pages.
Pablo, I didn't understand where I could make the change you suggested relating to 'Site Properties'.
Regards,
Geraint
<?php
error_reporting(E_ALL & ~E_NOTICE);
?><?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
if (session_id() == "")
{
session_start();
}
require_once("wb.mysql.crud.php");
session_start();
if (!isset($_SESSION['username']))
{
$_SESSION['referrer'] = $_SERVER['REQUEST_URI'];
header('Location: ./Failed-login.php');
exit;
}
if
Pablo, I didn't understand where I could make the change you suggested relating to 'Site Properties'.
Regards,
Geraint
<?php
error_reporting(E_ALL & ~E_NOTICE);
?><?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
if (session_id() == "")
{
session_start();
}
require_once("wb.mysql.crud.php");
session_start();
if (!isset($_SESSION['username']))
{
$_SESSION['referrer'] = $_SERVER['REQUEST_URI'];
header('Location: ./Failed-login.php');
exit;
}
if
Re: SQLCRUD and login using embedded database
Thanks Pablo, works perfectly, and gives me an insight into how I can resolve these php conflict problems in the future
Geraint
Geraint