Browser MMO Video #3

Location of the Videos
User avatar
Noctrine
Posts: 928
Joined: Thu Apr 23, 2009 9:57 pm

Re: Video#3

Post by Noctrine »

You said you used strip tags. I must have missed it skimming through.
Jesse Dorsey
ProjectANI - Lead Developer Person
http://about.me/jessedorsey
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#3

Post by hallsofvallhalla »

<?php
$player=$_POST['player'];
$password=$_POST['password'];
$pass2=$_POST['pass2'];
$player=strip_tags($player);
$email=$_POST['email'];
$email=strip_tags($email);
Animion
Posts: 4
Joined: Sat Jul 25, 2009 10:37 am

Re: Video#3

Post by Animion »

I don't know if you've found it, while making the next few videos or not, but there is a "Go To Line" option in CONText, press Ctrl+G, or go to "View" and then "Go To Line"


Great tutorial, everything went without a hitch on my end! :)
Image

...
I need to get a life...

On the upside, I like the colour scheme. :)
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#3

Post by hallsofvallhalla »

thanks for the tip
iamyou
Posts: 1
Joined: Wed Sep 30, 2009 1:03 pm

Re: Video#3

Post by iamyou »

Code: Select all

    <?php
    include 'connect.php';
    ?>

    <?php
    $player=$_POST['player'];
    $password=$_POST['password'];
    $pass2=$_POST['pass2'];
    $player=strip_tags($player);
    $email=$_POST['email'];
    $email=strip_tags($email);

    if ($email == "")
    {
    echo "You didn't enter an email address!<br>";
    echo " <A href='register.php'>Go back</a>";
        exit;
        }
    if ($password==$pass2)
    {
     
      $isplayer="SELECT * from players where name='$player'";
      $isplayer2=mysql_query($isplayer) or die("Could not query players table");
      $isplayer3=mysql_fetch_array($isplayer2);
      if(!$_POST['password'] || !$_POST['pass2'])
      {
         print "You did not enter a password";
        echo " <A href='register.php'>Go back</a><br>";
        exit;
      }
      else if($isplayer3 || strlen($player)>15 || strlen($player)<5)
      {
         print "There is already a player of that name or the name you specified is over 16 letters or less than 5 letter<br>";
         echo " <A href='register.php'>Go back</a>";
        exit;
      }
      else
      {
        $isaddress="SELECT * from players where email='$email'";
        $isaddress2=mysql_query($isaddress) or die("not able to query for password");
        $isaddress3=mysql_fetch_array($isaddress2);
        if($isaddress3)
        {
          print "There is already a player with that e-mail address<br>";
          echo " <A href='register.php'>Go back</a>";
        exit;
        }
        else
        {
            $password=md5($password);
           
    $SQL = "INSERT into players(name, password, email, level, exper) VALUES ('$player','$password','$email','1','0')";
          mysql_query($SQL) or die("could not register");
         
          print "Thank you for registering.";
       
        }
      }
    }

    else
    {
      print "Your password didn't match or you did not enter a password<br>";
       echo " <A href='register.php'>Go back</a>";
        exit;
    }
    echo "<br><A href='login.php'>Login Page</a>";
    ?>
can someone tell me where i've gone wrong when ever i try signing in it just refresh's the page when i check the data base there are no new accounts :(
User avatar
Hutch
Posts: 95
Joined: Wed Aug 12, 2009 11:12 pm

Re: Video#3

Post by Hutch »

Do you get an error message or anything? Does it just refresh you back to the register page? I have tried your reguser code and it works fine for me.
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#3

Post by hallsofvallhalla »

show us your register.php page
Foltergeist
Posts: 1
Joined: Wed Oct 07, 2009 7:10 pm

Re: Video#3

Post by Foltergeist »

Just a basic question for me.

How exactly do you move the input boxes(Insert User Name, Email Address,...)? Tried using "Position", but to no avail...
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#3

Post by hallsofvallhalla »

change the top and left fields in the css sheet.
phq
Posts: 14
Joined: Fri Dec 11, 2009 7:24 am

Re: Video#3

Post by phq »

Hey
the reguser is broken

Code: Select all

<?php
include 'connect.php';
?>

<?php
$player=$_POST['player'];
$password=$_POST['password'];
$pass2=$_POST['pass2'];
$player=strip_tags($player);
$email=$_POST['email'];
$email=strip_tags($email);

if ($email == "")
{
echo "You didn't enter a email address!<br>";
echo " <A href='register.php'>Go back</a>";
    exit;
    }
if ($password==$pass2)
{
  
  $isplayer="SELECT * from players where name='$player'";
  $isplayer2=mysql_query($isplayer) or die("Could not query players table");
  $isplayer3=mysql_fetch_array($isplayer2);
  if(!$_POST['password'] || !$_POST['pass2'])
  {
     print "You did not enter a password";
    echo " <A href='register.php'>Go back</a><br>";
    exit;
  }
  else if($isplayer3 || strlen($player)>15 || strlen($player)<1)
  {
     print "There is already a player of that name or the name you specified is over 16 letters or less than 1 letter<br>";
     echo " <A href='register.php'>Go back</a>";
    exit;
  }
  else
  {
    $isaddress="SELECT * from players where email='$email'";
    $isaddress2=mysql_query($isaddress) or die("not able to query for password");
    $isaddress3=mysql_fetch_array($isaddress2);
    if($isaddress3)
    {
      print "There is already a player with that e-mail address<br>";
      echo " <A href='register.php'>Go back</a>";
    exit;
    }
    else
    {
        $password=md5($password);
        
$SQL = "INSERT into players(name, password, email, level, exper) VALUES ('$player','$password','$email','1','0')";
      mysql_query($SQL) or die("could not register");

      print "Thank you for registering.";

    }
  }
}

else
{
  print "Your password didn't match or you did not enter a password<br>";
   echo " <A href='register.php'>Go back</a>";
    exit;
}
echo "<br><A href='login.php'>Login Page</a>";
?>
When I try to register it says You didn't enter a email address!
Post Reply

Return to “Older Browser MMO Videos”