Jump to content

[SOLVED] Hmmm More game help


tom2oo8

Recommended Posts

hmm not sure :( ima read the guides lol

But im sure this shoulkd work???

basicly it checks if the page=register and it will show that contents, but if its not it will show !1 !2 !3 and so on , The !3 and that are just there so i know its going to the right page but, when i actually go to the page eg page=register it wont show up and im confused???

 

 

<?php
session_start();
include "Database.php";
$page=$_GET['page'];

if($page!=register2) 
{
print " !1";
} 
else
{
$user=$_POST['username'];
$password=$_POST['password'];
$qry=mysql_query("SELECT username FROM users WHERE username='$user'");
$num_rows = mysql_num_rows($qry); 
if ($num_rows != 0) { 
echo "Sorry, the the username $username is already taken.<br>";
echo "<a href=index.php?page=register>Try again</a>";
} else {
mysql_query("INSERT INTO users (id, username, password, money, attacks, email) 
VALUES ('', '$_POST[username]', '$_POST[password]', '20000', '50')");


echo "Your user account has been created!<br>"; 
print "Now you can <a href=index.php?page=login>log in</a>"; 
}
if($page!=register)
{
print " !2";
} else {
print "
Register here
<form method='post' action='index.php?page=login2'>
Username: <input type='password' name='username'>   <p> </p>
Password: <input type='password' name='password'><p> </p>
<input type='submit' value='login'>
</form>	";

}
if($page!=login)
{
print " !3";
} else {
print "
Login here
<form method='post' action='index.php?page=login2'>
Username: <input type='password' name='username'>   <p> </p>
Password: <input type='password' name='password'><p> </p>
<input type='submit' value='login'>
</form>	";
}
if($page!=login2)
{
print " !4";
} else {

ob_start();

$username=$_POST['username'];
$password=$_POST['password'];

$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);

$sql="SELECT * FROM users WHERE username='$username' and password='$password'";
$result=mysql_query($sql);

$count=mysql_num_rows($result);


if($count==1){

session_register("username");
session_register("password");
header("location:index.php?page=logindone");
}
else {
echo "Wrong Username or Password";
}
ob_end_flush();
}
}
if($page!=logindone)
{
print " !5";
} 
else 
{
global $conn;
$userid=$_SESSION['id'];
$username=$_SESSION['username'];
$uq=mysql_query("SELECT attacks FROM users WHERE username='$username'") or die(mysql_error());
$attacks=mysql_fetch_array($uq);
print "<h1>You have logged on, {$username}! You have {$attacks['attacks']} attacks at the moment.</h1>";
}
if($page!=hideouts)
{
print " !6";
} else {
print "You can buy any of these wonderful places to stay in , You can only have 1 at a time though.
<style type='text/css'>
<!--
.style3 {
font-size: 18px;
color: #FF0000;
font-weight: bold;
}
.style4 {
color: #FF0000;
font-size: 14px;
}
.style5 {
color: #FF0000;
font-weight: bold;
}
.style7 {color: #FF0000}
-->
</style>
<table width='339' height='506' border='1' cellpadding='0'>
  <tr>
    <td width='174' height='139' valign='top'><p class='style3'>Shack</p>
      <p class='style4'>price $0</p>
      <span class='style4'>Defence 100      </span>
      <form name='form1' method='post' action='index.php?page=hideoutbuy1&proid=1&quant=1'>
        <label>
          <input type='submit' name='button' id='button' value='Submit'>
        </label>
      </form>      <p class='style4'> </p></td>
    <td width='153'><span class='style4'><img src='images/Shack.jpg' width='150' height='100' border='0' usemap='#Map'></span>
      <map name='Map'>
        <area shape='rect' coords='69,60,116,63' href='#'>
      </map>    </td>
  </tr>
  <tr>
    <td height='160' valign='top'><p class='style5'>Trailer</p>
      <p class='style7'>price $5000    </p>
      <p class='style7'>defence 300</p>
      <form name='form2' method='post' action='index.php?page=hideoutbuy1&proid=2&quant=1'>
        <label>
          <input type='submit' name='button2' id='button2' value='Submit'>
        </label>
    </form>      <p class='style7'> </p></td>
    <td><img src='images/Trailer.jpg' width='150' height='100'></td>
  </tr>
  <tr>
    <td valign='top'><p class='style5'>Appartment</p>
      <p class='style4'>Price $10000</p>
      <p class='style4'>Defence 600</p>
      <form name='form3' method='post' action='index.php?page=hideoutbuy1&proid=3&quant=1'>
        <label>
          <input type='submit' name='button3' id='button3' value='Submit'>
        </label>
      </form>
      <p>     </p>
    <p class='style4'> </p></td>
    <td><img src='images/Apartment.jpg' width='150' height='100'></td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
  </tr>
</table>
";
}


?>   

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.