must be cursed

Location of the Videos
Post Reply
Thomar
Posts: 4
Joined: Thu Jun 09, 2011 2:21 am

must be cursed

Post by Thomar »

I'm still having errors with the code from vid 3b i even copied the source code directly from the file that came with the tutorial download.
these are the error I am getting now. Dont understand how or why since i simply copy and pasted the code directly from the source code. any input would be greatly appreciated again
  • ( ! ) Notice: Undefined index: password in E:\wamp\www\Tutorial\reguser.php on line 7
    Call Stack
    # Time Memory Function Location
    1 -0.0000 386352 {main}( ) ..\reguser.php:0

    ( ! ) Notice: Undefined index: pass2 in E:\wamp\www\Tutorial\reguser.php on line 8
    Call Stack
    # Time Memory Function Location
    1 -0.0000 386352 {main}( ) ..\reguser.php:0

    ( ! ) Notice: Undefined index: email in E:\wamp\www\Tutorial\reguser.php on line 10
    Call Stack
    # Time Memory Function Location
    1 -0.0000 386352 {main}( ) ..\reguser.php:0

    ( ! ) Notice: Undefined index: classchoice in E:\wamp\www\Tutorial\reguser.php on line 12
    Call Stack
    # Time Memory Function Location
    1 -0.0000 386352 {main}( ) ..\reguser.php:0
    You didn't enter a email address!
    Go back
This is the code I used from the source code file

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);
$classchoice=$_POST['classchoice'];

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<br>";
echo " <A href='register.php'>Go back</a>";
exit;
}
else if($isplayer3 || strlen($player)>21 || 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";
echo " <A href='register.php'>Go back</a><br>";
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";
echo " <A href='register.php'>Go back</a><br>";
exit;
}
else
{
$password=md5($password);

 //////////////////////////////new for video 9//////////////
 $classquery="SELECT * from classes where name='$classchoice'";
  $classquery2=mysql_query($classquery) or die("Could not query classes");
  $classquery3=mysql_fetch_array($classquery2);

$SQL = "INSERT into players(name, password, email, level, exper, attack, defense, hpoints, maxhp, spoints, maxspoints,pclass) VALUES ('$player','$password','$email','1','0','$classquery3[attack]','$classquery3[defense]','$classquery3[hpoints]','$classquery3[hpoints]','$classquery3[spoints]','$classquery3[spoints]','$classquery3[name]')";
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";
echo " <A href='register.php'>Go back</a><br>";
exit;
}
 echo " <A href='login.php'>Login Page</a><br>";
?>
ricliv
Posts: 21
Joined: Tue Jul 06, 2010 11:35 am

Re: must be cursed

Post by ricliv »

Have you even touched the database?.. I think you shall wait till you are watching on video 14 before downloading the source because on almost every video he is changing codes in any php file, and I hope you didn't copy and paste all php files from source into "tutorial" folder.
User avatar
vitinho444
Posts: 2819
Joined: Mon Mar 21, 2011 4:54 pm

Re: must be cursed

Post by vitinho444 »

well, i think the error is on your register.php...

check the ID of the password textbox and check if its the same as in reguser.php

Other thing its that i think the database is not well connected...

else.. :

Code: Select all

You didn't enter a email address!
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: must be cursed

Post by hallsofvallhalla »

it is coming from your register.php..did you forget </form>?
User avatar
62896dude
Posts: 516
Joined: Thu Jan 20, 2011 2:39 am

Re: must be cursed

Post by 62896dude »

I'm with ricliv... It doesn't look like you added any of these things to your database. You definately defined the variables correctly, but I am almost positive that you simply don't have those in your database, and that is why it isn't working. Watch all of the tutorials thuroughly and dont skip any steps!
Languages: C++, C#, Javascript + Angular, PHP
Programs: Webstorm 2017, Notepad++, Photoshop
Current Project: HP Destiny
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: must be cursed

Post by hallsofvallhalla »

actually no..that is incorrect.

Look at the error lines. 7,8,9,10,12 ect.. they are the POST errors. Meaning you haven't defined them in the register.php page. It doesn't even look at the DB at these lines.
User avatar
vitinho444
Posts: 2819
Joined: Mon Mar 21, 2011 4:54 pm

Re: must be cursed

Post by vitinho444 »

so i won!! xD
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
Post Reply

Return to “Older Browser MMO Videos”