Page 1 of 1

Building A Game Website(DESPERATE HELP NEEDED)

Posted: Fri Jul 29, 2011 1:26 pm
by Suzanne M
I want to create a Jackpot game where the positive & negative numbers are randomly generated. I have written my code in Dreamweaver but I don't see the output of my PHP code. Instead of code I see the PHP symbol. I also want to know how to combine multiple functionalities in PHP. I want to create a table, store game credit, generate a random number etc. This is my current code.

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Jackpot</title>
</head>

<body>
<?php include "header.php"; ?>
<table width="100%" cellpadding="0" cellspacing="0" align="center">
<tr valign="top">
  <td width="100%" height="59" align="left" valign="top"><table width="100%" cellpadding="0" cellspacing="0" align="center">
    <tr valign="top">
      <td align="left" valign="top" bgcolor="#FFFFFF"><?php include "menu.php"; ?></td>
      <td width="100%" align="left" valign="top"><p align="center">Jackpot</p></td>
      </tr>
  </table>    <p align="center">&nbsp;</p></td>
</tr>
</table>
<?php include "footer.php";?>
<?php
$random_number = rand(-1000,1000);
echo "<p> You struck a Jackpot of </p>";
echo $random_number;
?>
<form action="Jackpot.php" method="post">
fingerValue: <input type="text" name="fingerValue" />
<input type="submit" />
</form>

</body>
</html>

Re: Building A Game Website(DESPERATE HELP NEEDED)

Posted: Fri Jul 29, 2011 3:51 pm
by internet-solution
whats your file extension?

Re: Building A Game Website(DESPERATE HELP NEEDED)

Posted: Fri Jul 29, 2011 3:52 pm
by oscardog
You'll need to use something like XAMPP as you cannot run PHP code within Dreamweaver. Alternatively, you can use some free web hosting.

Re: Building A Game Website(DESPERATE HELP NEEDED)

Posted: Sat Jul 30, 2011 2:41 am
by Suzanne M
@Internet Solution: .php
@Oscardog: I have XAMPP, I don't know how to use it. Anyways my main problem is I don't know how to put multiple different things in a table or execute multiple different things separately eg. generate a random number, capture form info all in one program. I also need to update gamer credit regularly. How do I do all this in one program?

Re: Building A Game Website(DESPERATE HELP NEEDED)

Posted: Sat Jul 30, 2011 11:55 am
by califdon
Suzanne M wrote:@Internet Solution: .php
@Oscardog: I have XAMPP, I don't know how to use it. Anyways my main problem is I don't know how to put multiple different things in a table or execute multiple different things separately eg. generate a random number, capture form info all in one program. I also need to update gamer credit regularly. How do I do all this in one program?
I don't want to be disrespectful, but really, what you are asking is for someone to tell you in an online forum how to learn programming. Programming is a rather complicated skill that requires you to read a book on PHP or follow some online PHP tutorials (you can Google to find many of them).

Re: Building A Game Website(DESPERATE HELP NEEDED)

Posted: Sat Jul 30, 2011 12:26 pm
by Suzanne M
Nvm I understood how to program what I wanted and I understood XAMPP. Now my qn is I created a game database with XAMPP. What info shud the database store? Jus game data which means all the random numbers the game can generate or also gamer details? The reason for my qn is in this game, the gamer will first deposit part of his credit value before playing the game, the game outputs a random credit value, this value gets added to the gamers existing credit, game over. So are user details also req storage? As in store Username, Current Credit, Generated Credit from game.

Re: Building A Game Website(DESPERATE HELP NEEDED)

Posted: Sat Jul 30, 2011 12:38 pm
by califdon
A database stores data that will or may be needed later. If you will need data at a future point, then you need to store it. If you won't need the data at a future point, then you don't need to store it.