Hello
I got this error message
Warning: Undefined variable: action in addnewpage.php on line 8
when I tried to execute this code.
<?php
session_start();
include("header.php");
include("root.php");
?>
<?php
//This script is used for logout
if($action =='logout')
{
session_unregister("username");
session_destroy();
print "<body>";
print "<center><b><font face=arial size=2 color=red><br>You have logged out successfully!</font></b>";
print "<form>";
print "<font face=Arial size=2><b><a href='../htdocs/userlogin.html'>Login</a></b></font>";
print "</form>";
print "</body>";
exit();
}
?>
$action is a button name whose value is "logout" if I click on that button then only that value will be passes and at the top I want to check if the action is logout then print the message and exit.
This code is working fine on WinNT and IIS
// version of php is 4.0.0
// Zend Engine v1.00
// MYSQL
Active Persistent Links 0
Active Links 0
Client API version 3.23.10
but when we try this on Unix
// PHP Version 4.0B2
// Zend Engine v0.90,
// MYSQL
Allow persistent links: Yes
Persistent links: 3/Unlimited
Total links: 3/Unlimited
Client API version: 3.22.27
it gives the warning is there a problem with coding or the way it is coded or there is some problem in instalation of PHP?
Help will be appriciated.
Thanks