So.....Close.......
Posted: Thu Sep 26, 2013 1:15 am
So, i'm THIS close to being able to breakthrough with my project and be done with it (maybe.......). I just need to know one more thing. But first, I kinda have to talk about the structure of the code. It runs three different functions to affect hte total, in this case we'll say $X. $X is updated on each of the functions. Got that part working down. But now I want to say if $X > 0, give a link to the front page and allow the user to run it again (with a user input on something that will change $X), and I got that part down. Now I just need to know how to declare $X = rand(0,1000); one time, then after that, it updates and keeps course with what it is after the function. SO basically after these functions, I want the user to be able to go to the home page, input a number for the other function that helps change $X, and $X stay the same as it was after the result of the first set of functions. Then I want to be able to display the result of the three functions and $X on the front page. Or maybe I should create a new page, identical to the front page, but have the session variables be called there? I'm a bit confused. Sorry for the long wall of text as well, and I hope it makes sense 
Also, I can't get it to echo $stock here. Help on that too?

Also, I can't get it to echo $stock here. Help on that too?

Code: Select all
<!DOCTYPE HTML>
<form action = "fish.php" method = post>
Input Harvest Rate<input type="text" name="harvest" id="harvest">
<input type = "submit" value="Submit">
</form>
<?php
$stock = rand(0,10000);
echo $stock;
?>
</html>