Page 1 of 1

Register.php error

Posted: Fri Oct 12, 2012 6:44 pm
by m1steha
The problem is that when i klick sumbit it stays on reguser.php page whats the problem

Code is

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 == "")
{
print "You didn't enter a email address!<br>";
print " <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 player's table.");
$isplayer3=mysql_fetch_array($isplayer2);

if(!$_POST['password'] || !$_POST['pass2'])
{
print "You didn't enter a password!<br>";
print " <a href='register.php'>Go back</a>";
exit;
}
else if($isplayer3 || strlen($player)>21 || strlen($player)<1)
{
print "There is already a player with that name or the name you specified is 

over 21 leters or less that 1 letter<br>";
print " <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 email address.<br>";
print " <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>";
print " <a href='register.php'>Go back</a>";
exit;
}
print " <a href='login.php'>Login Page</a><br>";

?>

Re: Register.php error

Posted: Fri Oct 12, 2012 8:12 pm
by Jackolantern
I could not find anything called "submit" in this script. Is this the script you can't get off of, or the one it won't go to? If this is the one it won't leave, what element are you clicking that won't respond? It would probably be best to post the script it won't go to plus the script that has the non-responding element so we get the whole picture.

Re: Register.php error

Posted: Sat Oct 13, 2012 4:08 pm
by m1steha
No thats the script i have to go but it wont just stays on that other page .....

If you can ust overwrite this script and post it

Re: Register.php error

Posted: Sat Oct 13, 2012 4:26 pm
by m1steha
I know now the problem is with my reguser plz tell me why the reguser script doesn't transfer me to register.php page


Code: Select all

<?php
include 'connect.php';

?>

<form method ="post" action="reguser.php">
Type Username Here: <input type="text" name="player" size="21">
<br>
Type Password Here: <input type="text" name="passsword" 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: Register.php error

Posted: Sat Oct 13, 2012 4:37 pm
by Jackolantern
The first thing to try is closing your form tag. Put a </form> under the submit button, and see if that fixes it :)

Re: Register.php error

Posted: Sat Oct 13, 2012 4:39 pm
by m1steha
Ahh?? dont get what are u saying

Re: Register.php error

Posted: Sat Oct 13, 2012 4:45 pm
by m1steha
please do it yourself and then post the code

Re: Register.php error

Posted: Sat Oct 13, 2012 5:08 pm
by m1steha
http://uksparimaid.webege.com/reguser.php try this you can se what is the problem

Re: Register.php error

Posted: Sat Oct 13, 2012 7:03 pm
by Jackolantern
m1steha wrote:please do it yourself and then post the code
That is what I am supposed to be telling you lol. I was pretty clear with what you needed to do. You just need to add one single HTML tag at the bottom of the shorter script (I believe that is register.php, but just know it is the shorter one with the <form> tag in it).

Re: Register.php error

Posted: Sun Oct 14, 2012 11:01 am
by m1steha
I have done this already see

Code: Select all

?php

?>

<form method ="post" action="reguser.php">
Kasutaja nimi: <input type="text" name="player" site="21"><br>
Parool: <input type="text" name="password" site="15"><br>
Parool uuesti: <input type="text" name="pass2" site="15"><br>
E-mail: <input type="text" name="email" site="60"><br>

<input type="submit" value="submit">
</form>