Toast Begginer
Posts : 3 Join date : 2008-07-08
| Subject: Logout character + EXP Fix Tue Jul 08, 2008 9:46 pm | |
| I think it'd be very helpful if there was a link on the forum or registration page that allows the user to logout a character that is "already logged in." Sometimes I lag, so I sign off in hopes that it'll be gone when I go back on. But then I get the message that my character is already logged in. I think having a logout page would be really helpful. I haven't come across the negative experience problem in this server yet, but maybe you can use this as a future reference? I've done some searching and if you need the php scripts, I have posted them below. Hope you take this suggestion into consideration. I don't know who developed these scripts, I just found them on RaGEZONE, so credits go to them. Character Logout: - Quote :
- You have to type something in.");
$usr = mysql_real_escape_string($usr); // prevents SQL injection
$result = mysql_query("SELECT name, password, loggedin FROM accounts"); while($row = mysql_fetch_array($result)) { $loggedin = $row[2]; $validlogin = 1; break; } if($validlogin == 0) { echo ""; die(" This Account doesn't exist! "); } else { if($loggedin > 0) { mysql_query("UPDATE accounts SET loggedin = 0 WHERE name = '$usr'"); echo ""; die(" $usr has been logged out. "); } else { echo ""; die(" $usr! is already logged out. "); } } } else { echo " "; echo "The Logout Script.
"; echo " AccName: "; echo "
"; echo " "; } mysql_close($conn); ?> Negative EXP Fix: - Quote :
- <?php
$conn = mysql_connect("localhost", "root", "") or die ('Error connecting to mysql!'); mysql_select_db("odinms");
$self = $_SERVER['PHP_SELF'];
if(isset($_POST['fame'])) { $validlogin = 0; $usr = $_POST['user'];
if($usr == "") die("<h1> Required field was left blank.</h1>");
$usr = mysql_real_escape_string($usr); // prevents SQL injection
$result = mysql_query("SELECT exp FROM characters WHERE name = '$usr' AND exp < 0"); while($row = mysql_fetch_array($result))
{ $loggedin = $result; $validlogin = 1; break; }
if($validlogin == 0) { echo "<meta http-equiv='refresh' content='4;url=$self'>"; die("<h1> This character doesn't exist or it has more than 1 exp! </h1>"); } else { if($loggedin) { mysql_query("UPDATE characters SET exp = 1 WHERE name = '$usr'"); echo "<meta http-equiv='refresh' content='10;url=$Self'>"; die("<h1>$usr now has 0 exp.</h1>");
} else { echo "<meta http-equiv='refresh' content='4;url=$self'>"; die("<h1>$usr has more than 1 exp!</h1>"); } } } else { echo "<form method='post'>"; echo "<font face = verdana size = 3><b><u>Negative Exp Fix<p></u></b>"; echo "<font face = verdana size = 2><b><u>Log off your character or this will not work!<p></u></b>"; echo "<font face = verdana><table border='0'><tr><td>Character: </td><td><input type='text' name='user' id='user'></td></tr></table>"; echo "<input type='submit' name='fame' id='submit' value='Submit'><p>"; echo "</form>"; }
mysql_close($conn);
?> | |
|
Admin Admin
Posts : 87 Join date : 2008-07-03
| Subject: THANKS! Tue Jul 08, 2008 10:02 pm | |
| THANKS A LOT!
Thank you, Admin(Owner) | |
|
Admin Admin
Posts : 87 Join date : 2008-07-03
| Subject: Help! Can somebody tell me where to add these! Wed Jul 09, 2008 10:37 am | |
| Can somebody tell me where to add these, like what file. Thanks!
Thank you, Admin(Owner) | |
|
Toast Begginer
Posts : 3 Join date : 2008-07-08
| Subject: Re: Logout character + EXP Fix Wed Jul 09, 2008 7:05 pm | |
| I think it's like register and rankings page on http://5.224.248.60:8000You had special scripts for those pages, right? I think you just do the same with the logout and EXP fix scripts, then just add links for them. I'm not sure though... haven't done anything like this before. | |
|
[GM]Coldplay Moderator
Posts : 34 Join date : 2008-07-07 Location : Illinoizz U S A
| Subject: Re: Logout character + EXP Fix Wed Jul 09, 2008 7:22 pm | |
| Make a copy of the webpage for registration and replace that code with this one and save it as a seperate page... i think... | |
|
gimmeryce Begginer
Posts : 5 Join date : 2008-07-08
| Subject: Re: Logout character + EXP Fix Wed Jul 09, 2008 11:01 pm | |
| lol if you get it to work, can you let us know when regi is up? | |
|
[GM]Coldplay Moderator
Posts : 34 Join date : 2008-07-07 Location : Illinoizz U S A
| Subject: Re: Logout character + EXP Fix Wed Jul 09, 2008 11:33 pm | |
| - gimmeryce wrote:
- lol if you get it to work, can you let us know when regi is up?
Tommorow during the daytime is probably your best bet. | |
|
yarden15005 Moderator
Posts : 31 Join date : 2008-07-11 Age : 31 Location : isreal
| Subject: Re: Logout character + EXP Fix Sun Jul 13, 2008 2:02 pm | |
| but it can be on forums? all the links like bad exp fix and cash shop and all the things are on a normal site u dont think to do a one too? with a link of download and registar in the side it can be nice | |
|
Sponsored content
| Subject: Re: Logout character + EXP Fix | |
| |
|