hey volka, I noticed you didn't register any session variables
was that on purpose?
Little Help on Arrays? :)
Moderator: General Moderators
-
JPlush76
- Forum Regular
- Posts: 819
- Joined: Thu Aug 01, 2002 5:42 pm
- Location: Los Angeles, CA
- Contact:
ahh thank the lord for the manual 
I just read:
Use of $_SESSION (or $HTTP_SESSION_VARS with PHP 4.0.6 or less) is recommended for security and code readablity. With $_SESSION or $HTTP_SESSION_VARS, there is no need to use session_register()/session_unregister()/session_is_registered() functions. Users can access session variable like a normal variable
thanks volka I got it working with the following code
I just read:
Use of $_SESSION (or $HTTP_SESSION_VARS with PHP 4.0.6 or less) is recommended for security and code readablity. With $_SESSION or $HTTP_SESSION_VARS, there is no need to use session_register()/session_unregister()/session_is_registered() functions. Users can access session variable like a normal variable
thanks volka I got it working with the following code
Code: Select all
session_start();
//***** INCLUDE GLOBAL MASTER FILE
include ("includes/main.php");
// SEE IF THE USER HAS VIEWED THIS MEMBER IN THE SESSION, IF NOT UPDATE THE MEMBERS VIEWS
if (isset($_GETї'id']))
{
$user_id = $_GETї'id'];
if (!isset($_SESSIONї'members']))
{
$result = query_db("UPDATE user SET views=(views + 1) WHERE user_id = $user_id");
$_SESSIONї'members'] = array($user_id);
// session_register("counted",);
}
else {
if(!in_array($user_id, $_SESSIONї'members']))
{
$result = query_db("UPDATE user SET views=(views + 1) WHERE user_id = $user_id");
array_push($_SESSIONї'members'], $user_id);
}
}
}