Skip to main content
Participant
April 9, 2021
Question

Session

  • April 9, 2021
  • 3 replies
  • 195 views

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 has been closed for replies.

3 replies

BenPleysier
Community Expert
Community Expert
April 10, 2021

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

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
April 9, 2021

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.

 

Nancy O'Shea— Product User & Community Expert
Legend
April 9, 2021

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?