Hello,
I was trying to write a simple shopping example, which allows the user
to select two poducts and we kept a counter of each item. In this
code, the sessions are created, but the files value does not increase.
I would appreciate some guidance.
Thank you
<?php
session_save_pa th("c:");
session_registe r("item1");
session_registe r("item2");
?>
<?php
if(isset($_GET['Item1'])){
$GLOBALS["item1"]++;
}
if(isset($_GET['Item2'])){
$GLOBALS["item2"]++;
}
?>
<html>
<head>
<title>Test Page</title>
</head>
<body>
<form>
<input type="submit" name="Item1" value="Item 1">
<input type="submit" name="Item2" value="Item 2">
</form>
</body>
</html>
I was trying to write a simple shopping example, which allows the user
to select two poducts and we kept a counter of each item. In this
code, the sessions are created, but the files value does not increase.
I would appreciate some guidance.
Thank you
<?php
session_save_pa th("c:");
session_registe r("item1");
session_registe r("item2");
?>
<?php
if(isset($_GET['Item1'])){
$GLOBALS["item1"]++;
}
if(isset($_GET['Item2'])){
$GLOBALS["item2"]++;
}
?>
<html>
<head>
<title>Test Page</title>
</head>
<body>
<form>
<input type="submit" name="Item1" value="Item 1">
<input type="submit" name="Item2" value="Item 2">
</form>
</body>
</html>
Comment