Page 28 of 35
					
				Re: Video#5
				Posted: Sun May 15, 2011 11:37 pm
				by Jackolantern
				What on Earth? Another issue with a variable not being passed from the form? We had one of these the other day. I have never had one of these personally. What is causing them? Because the code seems fine.
			 
			
					
				Re: Video#5
				Posted: Mon May 16, 2011 2:11 am
				by hallsofvallhalla
				i need to look on how we fixed the last one. It must be something to do with Wamp or the browser. What browser and version are you using?
			 
			
					
				Re: Video#5
				Posted: Mon May 16, 2011 2:15 am
				by aim
				I am using google chrome version 11.0.696.68 (current) and wamp version 2.1 64 bit
			 
			
					
				Re: Video#5
				Posted: Mon May 16, 2011 2:18 am
				by aim
				just tried in firefox and internet explorer (current versions) with no luck.
			 
			
					
				Re: Video#5
				Posted: Mon May 16, 2011 1:36 pm
				by hallsofvallhalla
				is your wamp icon green in your tray?
if so try this,  create a page called test.php
Code: Select all
<form method="post" action="test2.php">
Type something in here: <input type="text" name="testpost" size="15"><br>
<input type="submit" value="submit">
then create another page called test2.php
Code: Select all
<?php
$testvariable = $_POST['testpost'];
echo "You typed " . $testvariable;
?>
save these where ever and navigate to them in the browser localhost\directory\test.php
see what heppens
 
			
					
				Re: Video#5
				Posted: Mon May 16, 2011 3:29 pm
				by aim
				Yes, it is green.
When I go to test.php it works, type something in and it directs me to test2.php which says what i typed.
			 
			
					
				Re: Video#5
				Posted: Mon May 16, 2011 4:31 pm
				by hallsofvallhalla
				aha! then cope and paste this.  dont worry about it looking exactly the same. let me know the result
register.php
Code: Select all
<form method ="post" action="reguser.php">
Type Username Here: <input type="text" name="player" size="21"><br>
Type Password Here: <input type="text" name="password" size "15"><br>
ReType Password Again: <input type="text" name="pass2" size "15"><br>
Type Email Address: <input type="text" name="email" size "60"><br>
<input type="submit" value="submit">
 
			
					
				Re: Video#5
				Posted: Mon May 16, 2011 4:41 pm
				by aim
				Just fixed it and came to say so when I saw your post. Not sure what it was, but continued through video 9 and i guess the code from it fixed the error. Thanks for the help.
			 
			
					
				Re: Video#5
				Posted: Thu May 19, 2011 5:11 am
				by Articus
				Watcher wrote:I am just starting this, everything has been fine till now, after I log in I get the goblin stats but none for  the player just shows this.
Hit points = 
Attack = 
Defense = 
Goblin
Hit points = 5
Attack = 3
Defense = 3
Attack!
I actually get what Watcher gets as well, which has been boggling my mind. I first wrote my own code and then thought I messed up, so I copy and pasta'd the code in from the videos and still got this problem. It is letting someone with a blank name be logged into the game. There is no user with a blank name and the code looks identical. Any help?
Code: Select all
    <?php
    include_once 'connect.php';
    session_start();
    if (isset($_POST['submit']))
    {
      $player=$_POST['player'];
      $password=$_POST['password'];
      $player=strip_tags($player);
      $password=strip_tags($password);
      $password=md5($password);
      $query = "select name,password from players where name='$player' and password ='$password'";
      $result = mysql_query($query) or die("Could not query players");
      $result2 = mysql_fetch_array($result);
      if ($result2)
      {
        $_SESSION['player']=$player;
       
        echo "<big>Logged in successfully<br>";
        echo "<A href='battle.php'>Continue</a></big>";
      }
      else
      {
        echo "<big>Wrong username or password.<A href='login.php'>Try Again</a></big>";
      }
    }
    ?>
Code: Select all
<?php
    include_once 'connect.php';
    session_start();
    if (isset($_SESSION['player']))
    {
      $player=$_SESSION['player'];
    }
    else
    {
      echo "Not Logged in <br><br> <A href='login.php'>Login</a>";
      exit;
    }
    $playerinfo="SELECT * from players where name='$player'";
    $playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
    $playerinfo3=mysql_fetch_array($playerinfo2);
...
 
			
					
				Re: Video#5
				Posted: Thu May 19, 2011 2:18 pm
				by hallsofvallhalla
				can you show us the actual stat panel code? 
 also I do not recommend anyone attempting the code until video 14 or more. It is only going to aggravate you. We have seen it well more than 1,000 times here. Watch then download code at 14 or maybe even 20