Register.php error

C++, C#, Java, PHP, ect...
Post Reply
m1steha
Posts: 9
Joined: Fri Oct 12, 2012 5:16 pm

Register.php error

Post 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>";

?>
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Register.php error

Post 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.
The indelible lord of tl;dr
m1steha
Posts: 9
Joined: Fri Oct 12, 2012 5:16 pm

Re: Register.php error

Post 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
m1steha
Posts: 9
Joined: Fri Oct 12, 2012 5:16 pm

Re: Register.php error

Post 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">
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Register.php error

Post 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 :)
The indelible lord of tl;dr
m1steha
Posts: 9
Joined: Fri Oct 12, 2012 5:16 pm

Re: Register.php error

Post by m1steha »

Ahh?? dont get what are u saying
m1steha
Posts: 9
Joined: Fri Oct 12, 2012 5:16 pm

Re: Register.php error

Post by m1steha »

please do it yourself and then post the code
m1steha
Posts: 9
Joined: Fri Oct 12, 2012 5:16 pm

Re: Register.php error

Post by m1steha »

http://uksparimaid.webege.com/reguser.php try this you can se what is the problem
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Register.php error

Post 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).
The indelible lord of tl;dr
m1steha
Posts: 9
Joined: Fri Oct 12, 2012 5:16 pm

Re: Register.php error

Post 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>
Post Reply

Return to “Coding”