Welcome to the Robot Favorite Test
dbhost, $global->dbuser, $global->dbpass, $global->dbname); $dbase->setup_connection(); /* ============= start page ============= */ session_start(); // $robotid=(int)$_REQUEST['id']; $_SESSION['returnpage'] = $_SERVER['REQUEST_URI']; // $robot=$_REQUEST['id']; $user=_SESSION['uid']; ?> issue_query($sql); while ($fav = $result->fetch_assoc()) { foreach ($fav as $value) $id = array_values($fav)[0]; $robot = array_values($fav)[1]; /* Send the message issue_query with an SQL query. */ $sql="SELECT * FROM `robot` WHERE `robotid`='" . $robot . "'"; $result=$dbase->issue_query($sql); while ($row = $result->fetch_assoc()) { foreach ($row as $value) $id = array_values($row)[0]; $admin = array_values($row)[1]; $user = array_values($row)[2]; $name = array_values($row)[3]; $description = array_values($row)[4]; $location = array_values($row)[5]; $type = array_values($row)[6]; $access = array_values($row)[7]; $online = array_values($row)[8]; $image = array_values($row)[9]; $ip = array_values($row)[10]; $robotid=$id; // xxxxx ?>
issue_query($sql); $row = $result->fetch_assoc(); $uid = $row['uid']; $favorite = $row['robotid']; echo "
strings: $userid : $robot
table: $uid : $favorite
"; echo "
favorite button
"; if (($userid==$uid)&&($robot==$favorite)){ // button - remove from favorites include ('button.fav.delete.htm'); }else { // button - add to favorites include ('button.fav.add.htm'); } echo "action: [" . $_SESSION['action'] . "]"; ?>
Wonder what will happen !!!