Jump to content

Counter help


nblackwood

Recommended Posts

Hey all. I have a counter i developed. Everything works well, except when the counter reaches 0 when counting backwards, I need it to stop it doesn't. It just continues into the negative values. Here is my code:

 

<?php
$AddFields = $_SESSION['NumFields'];
$RemoveFields = $_SESSION['NumFields'];



	if(isset($_POST['Add']))
	{
		$AddFields = $_SESSION['NumFields'] ++;
		$TotalFields = $AddFields +1;
	}

	if(isset($_POST['Remove']))
	{
		$RemoveFields = $_SESSION['NumFields'] --;
		$TotalFields = $RemoveFields -1;
	}
?>

 

Help is appreciated.

Link to comment
https://forums.phpfreaks.com/topic/206748-counter-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.