<?php
$quantity = $_POST['input'];
$quantity_first = fopen('quantity.php', w);
$became = $quantity - $quantity_first;
fwrite($quantity_first, $became);
header('Location: ../../index.php');
exit;
?>
<form action="items/apple/script.php" rule="form" method="POST">
<input type="number" name="input">
<button>Продать</button>
</form>
$quantity_first = fopen('quantity.php', w);