refreshing page after a function call
Posted: Mon Jan 13, 2003 10:27 am
I have some text that calls a function when clicked. The function updates a value in an array. A number on the page then needs to be changed to reflect this new value. How do I refresh the page without resetting all the values of the array? Here is a sample of what is happening
When I click "ADD" or "Remove" nothing happens. Any help would be appreciated.
Code: Select all
<?
session_start();
if (!isset($_SESSION['uid']) ) {
$_SESSION['s_box'];
?>
<?php
Class Box {
var $addeditems;
function add_Remove($id,$qty) {
$this->$addeditems[$id] = $qty;
}
}
$s_box = new Box();
?>
<a HREF= "<?php echo ($PHP_SELF); ?>" onclick="<?php $s_box->add_Remove('state_dc','1'); ?>">ADD</a>
<a HREF= "<?php echo ($PHP_SELF); ?>" onclick="<?php $s_box->add_Remove('state_dc','-1'); ?>">Remove</a>
<?php
if($addeditems['state_dc'] == 1){
?><td><? echo $addeditems['state_dc']; ?></td>
<?
}
?>