#EANF#
This is my PHP:
$file = fopen("1stock.js", "c+");
$number = fseek($file, 20, SEEK_CUR);
$fh = fgetc($number);
fwrite($file, $fh -1);
My 61st character is a number I want to do that number - 1when the php
file loads. Why is this not working?
I am also looking to do this for multiple other positions on a .js file,
that looks a bit like this:
var item1_stockS = 5 //20th character including space.
var item1_stockM = 8
var item1_stockL = 3
I have a HTML form that looks like this:
<form action="stock.php" method="post">
Item1 S:<input value="remove" name="remove1S" type="submit" /> <br/>
<script type="text/javascript">document.write(item1_stockS);</script><br/>
Item1 M:<input value="remove" name="remove1M" type="submit" /> <br/>
<script type="text/javascript">document.write(item1_stockM);</script>
<br/>
Item1 L:<input value="remove" name="remove1L" type="submit" /><br/>
<script type="text/javascript">document.write(item1_stockL);</script>
<br/>
So that when you click on one of the button it removes 1 item from the
corresponding stock number.
No comments:
Post a Comment