after submit page....
Moderator: General Moderators
-
fariquzeli
- Forum Contributor
- Posts: 144
- Joined: Mon Jun 24, 2002 9:16 am
- Location: Chicago
- Contact:
-
fariquzeli
- Forum Contributor
- Posts: 144
- Joined: Mon Jun 24, 2002 9:16 am
- Location: Chicago
- Contact:
Tried HTTP_COOKIE_VARS
as well still the same error message
it comes on the second function
it comes on the first line containing $HTTP_COOKIE_VARS in the second function. Any Ideas?
as well still the same error message
it comes on the second function
Code: Select all
function setUserMessage($message, $error=false) {
session_start();
if ($error)
$HTTP_COOKIE_VARSї'user_message'] = "<font face='verdana,arial'color='red'> $message </font>";
else
$HTTP_COOKIE_VARSї'user_message'] = $message;
}
function printUserMessage() {
session_start();
if ($HTTP_COOKIE_VARSї'user_message'] != "")
echo $HTTP_COOKIE_VARSї'user_message'];
$HTTP_COOKIE_VARSї'user_message'] = "";
}it comes on the first line containing $HTTP_COOKIE_VARS in the second function. Any Ideas?
-
fariquzeli
- Forum Contributor
- Posts: 144
- Joined: Mon Jun 24, 2002 9:16 am
- Location: Chicago
- Contact:
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
If you're using one of the $HTTP_xxx_VARS arrays you have to declare it as global within your function:
If you're using PHP version 4.1 or above use $_COOKIE instead (it's autoglobal so you don't have to declare it).
Mac
Code: Select all
function setUserMessage($message, $error=false) {
global $HTTP_COOKIE_VARS;
session_start();
if ($error) {
$HTTP_COOKIE_VARSї'user_message'] = "<font face='verdana,arial'color='red'> $message </font>";
} else {
$HTTP_COOKIE_VARSї'user_message'] = $message;
}
}Mac