Alright ran into a bit of a problem on the item count in my index... let me give you the layout I'm working with.
I've got my index page with the header logo and navigation bar. This is followed by an Iframe. When I click the navigation buttons it changes to Iframe to show a new webpage.
The problem I'm having is, I have a <td> in the top part of the Index (page never changes) that has a text element inside of it that calls a PHP function to show the number of items I have in the cart. So I have to reload the main page, which reloads everything back to the start in order to see the number of items.
This is the function is case you were wondering
function total_items(){
global $sid;
if($_SESSION["loggedin"]==1){
$q1=mysql_query("SELECT SUM(qty) as total_items FROM cart_items WHERE uid='{$_SESSION["user_id"]}'");
}else{
$q1=mysql_query("SELECT SUM(qty) as total_items FROM cart_items WHERE session='$sid'");
}
$r1=mysql_fetch_array($q1);
return $r1["total_items"];
}
and this is how I call it in just the text area:
<td><font color="#000000">(<?= total_items(); ?> items)</font></td>
my friend had mentioned something about AJAX, but I'm not too familiar with the blending of fields.
I appreciate any info I can get, even if its just a link to something to look up.