mitchell
08-04-2007, 10:48 AM
my inspiration is to make a game that is fun which involves gold,lumber and stone (the 3 sets of numbers at the top of the page)
and clicking a link which is [build house to Level 2] costing ???,???,??? of each resource and then it goes to the next page with it subtracted from the top.
this has been bothering for a while and have been hunting on the web for any code and pieces to put together to make this script and as i have no, mysql etc i am limited to a text file based system which im happy with.
foxbeefly has already provided me with this to oint me in the right direction and has said he would help me:
<?php
$LUCKY_ONE = '1944';
$LUCKY_TWO = '1415';
$LUCKY_THREE = '4534';
if(isset($_POST['go'])){
$one = $LUCKY_ONE - $_POST['one'];
$two = $LUCKY_TWO - $_POST['two'];
$three = $LUCKY_THREE - $_POST['three'];
}
?>
<html>
<head>
<meta HTTP-EQUIV='refresh' CONTENT='60'> //<!--refresh (reload) the page every 60 seconds -*->
</head>
<body>
<h1>My Crazy number game</h1>
<p>LUCKY ONE: <?php echo $LUCKY_ONE ?></p>
<p>LUCKY TWO: <?php echo $LUCKY_TWO ?></p>
<p>LUCKY THREE: <?php echo $LUCKY_THREE ?></p>
<form method='POST' action='php.php'>
<p>One<input value='<?php echo $one ?>' type='text' name='one' size='20' /></p>
<p>Two<input value='<?php echo $two?>' type='text' name='two' size='20'></p>
<p>Three<input value='<?php echo $three?>' type='text' name='three' size='20'></p>
<p><input type='submit' value='GO!' name='go'></p>
</form>
</body>
</html>
if you could fknow and point me in the right direction aswell , i will be happy to help you out with anything.
David
and clicking a link which is [build house to Level 2] costing ???,???,??? of each resource and then it goes to the next page with it subtracted from the top.
this has been bothering for a while and have been hunting on the web for any code and pieces to put together to make this script and as i have no, mysql etc i am limited to a text file based system which im happy with.
foxbeefly has already provided me with this to oint me in the right direction and has said he would help me:
<?php
$LUCKY_ONE = '1944';
$LUCKY_TWO = '1415';
$LUCKY_THREE = '4534';
if(isset($_POST['go'])){
$one = $LUCKY_ONE - $_POST['one'];
$two = $LUCKY_TWO - $_POST['two'];
$three = $LUCKY_THREE - $_POST['three'];
}
?>
<html>
<head>
<meta HTTP-EQUIV='refresh' CONTENT='60'> //<!--refresh (reload) the page every 60 seconds -*->
</head>
<body>
<h1>My Crazy number game</h1>
<p>LUCKY ONE: <?php echo $LUCKY_ONE ?></p>
<p>LUCKY TWO: <?php echo $LUCKY_TWO ?></p>
<p>LUCKY THREE: <?php echo $LUCKY_THREE ?></p>
<form method='POST' action='php.php'>
<p>One<input value='<?php echo $one ?>' type='text' name='one' size='20' /></p>
<p>Two<input value='<?php echo $two?>' type='text' name='two' size='20'></p>
<p>Three<input value='<?php echo $three?>' type='text' name='three' size='20'></p>
<p><input type='submit' value='GO!' name='go'></p>
</form>
</body>
</html>
if you could fknow and point me in the right direction aswell , i will be happy to help you out with anything.
David