Skip to main content
Participant
Apr 9, 2021 7:54 PM UTC
Question

Session

Session not working in IIS or WAMP using PHP, MySQL, Webassist and Dreamweaver on localhost .  All pages were developer months ago and are working on GoDaddy server.  All five websites are no-longer recording the data from Store Result.  Evenwrote a test page. Get this message "
Notice: Undefined variable: ok in C:\wampserver64\www\lccc\A_SESSION TEST.php on line 12
session FAILED".  Been trying to selove for a month.  Can anyone help. [personal info removed by moderator]

 

<?php
session_start();
?>
<!doctype html>
<html >
<head>
<meta charset="UTF-8">
<title>Test</title>
</head>
<body>
<?php
echo $ok ? 'session OK' : 'session FAILED';
?>
</body>
</html>

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

BenPleysier
Community Expert
Community Expert
Apr 10, 2021 12:35 AM UTC

Could you give us a link to one of the 5 websites so that we can see what is going on.

Translate
Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Nancy OShea
Community Expert
Community Expert
Apr 9, 2021 8:10 PM UTC

Which version of PHP is installed on your local server?

Which version of PHP is installed on GoDaddy's server?

 

 

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PHP Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<?php phpinfo() ?>
</body>
</html>

 

 

Ideally both server's should be using the same set-up.

 

Translate
Nancy O'Shea— Product User & Community Expert
Legend
Apr 9, 2021 8:03 PM UTC

Where are you getting the $ok variable from? The error is saying the variable $ok can't be found as its not been set in the code available and therefore cant check if a session is active so its returning failed.

 

You're usually checking a condition like:

 

$ok = 20;
echo $ok > 10 ? 'session OK' : 'session FAILED';

 

But I dont know what the variable $ok is?

Translate