Really need help (sql , php)
#1

Ok, this is the story:

1. I used an Tkadmin filterscript
2. I want make an registration system, (the register would be on the website like register.php)
3. I have done make the registration system (like form & the php code)
4. Get a little prob.

registerform.php
Код HTML:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>register</title>
</head>
<body  bgcolor="black"    style="color:white;">
<FORM ACTION="register.php" METHOD=get>
<h1>welcome to the registration page</h1>
please input the registration details to create an account here<br>
<table border="2">
<tr>
<td>User Name :</td><td><input name="regname" type="text" size"20"></input></td>
</tr>
<tr>
<td>email :</td><td><input name="regemail" type="text" size"20"></input></td>
</tr>
<tr>
<td>password :</td><td><input name="regpass1" type="password" size"20"></input></td>
</tr>
<tr>
<td>retype password :</td><td><input name="regpass2" type="password" size"20"></input></td>
</tr>
</table>
 <input type="submit" value="register me!"></input>
</FORM>
</body>
</html>
register.php
PHP код:
<?php
 session_start
();session_destroy();
 
session_start();
if(
$_GET["regname"] && $_GET["regemail"] && $_GET["regpass1"] && $_GET["regpass2"] )
{
    if(
$_GET["regpass1"]==$_GET["regpass2"])
    {
    
$servername="localhost";
    
$username="root";
    
$conn=  mysql_connect($servername,$username)or die(mysql_error());
    
mysql_select_db("sa-mp",$conn);
    
$sql="insert into playerinfo (user,password,kills,deaths,score,money,IP,adminlvl,email)values('$_GET[regname]','$_GET[regpass1]','0','0','0','0','0','0','$_GET[regemail]')";
    
$result=mysql_query($sql,$conn) or die(mysql_error());        
    print 
"<h1>you have registered sucessfully</h1>";
    
$_SESSION['Logged']=1;
    print 
"<a href='index.php'>go to login page</a>";
    }
    else print 
"passwords doesnt match";
}
else print
"invaild input data";
?>
Registration system working great, I check the database.
See the picture


But when i try to login in game, theres a problem that say i not registered.
Im not registered on the website too

I see that i must set the Logged variable to 1.
how i can add the Logged variable on the register.php
Like:
Код:
SetPVarInt(playerid, "Logged", 1);
but above is only for pawn.exe

need help, what i must to do?
Reply
#2

Why don't you ask this on the Admin Script topic by TK? Or even PM TK? We can't really help because we don't know how's it made.
Reply
#3

He didnt reply it
Reply
#4

Okay first off:
Why are you doing
PHP код:
session_start();session_destroy(); 
 
session_start(); 
All you need to do is call session_Start(); once.

That isn't the issue though.

Are you sure the login segments of code are correctly connecting to the MySQL database, and if so, are they correctly pulling data from the database to compare it? Try printing what is received from the database on the gamemode.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)