Register for your free account! | Forgot your password?

You last visited: Today at 07:49

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Work ON] User Control Panel

Discussion on [Work ON] User Control Panel within the Shaiya PServer Development forum part of the Shaiya Private Server category.

Reply
 
Old 10/31/2015, 10:42   #16
 
beetols's Avatar
 
elite*gold: 0
Join Date: Jan 2013
Posts: 461
Received Thanks: 561
Quote:
Originally Posted by DevilOfSun View Post
PHP Code:
<?php

require_once('db.config.php');

$character '';

?>
-- Script From [DEV]Viro

<html>
    <head>
        <title>[Dev]Viro Faction Change</title>
    <style type="text/css">
        h2         {text-align:center; color:yellow;}
        h4         {text-align:center; color:white;}
        div#adminLogin    {background-color:#111111; width:160px; padding:10px;}
        div#formArea    {background-color:#595959; padding:5px; position:relative; left:0px;}
        .submitButton    {position:relative; left:40px;}
        
    </style>
    </head>
    <body>
        <div id="adminLogin">
            
            <div id="factionChange"><h4>Faction Change</h4>

                <div id="formArea">
                    <form action="factionchange.php" method="POST">
                        Account<br/><input type="text" name="character" value="<?php echo $account?>"><br/>
                        Passwort<br/><input type="text" name="password" value="<?php echo $password?>"><br/>
                        <br/><input type="submit" name="formSubmit" value="Submit" class="submitButton">
                    </form>
                </div>
            </div>
        </div>
    </body>
</html>
<?php

if ($_POST['formSubmit'] == "Submit") {
    
$account $_POST['account'];
    
$password $_POST ['Pw'];
    
$dbhost $_ENV['LOCAL_DOMAIN'];

    
$sql "SELECT UserUID FROM PS_UserData.dbo.Users_Master WHERE UserID = ? and Pw = ?";
    
$stmt odbc_prepare($GLOBALS['dbConn'],$sql);
    
$args = array($account);
    
$args = array ($password);
    
odbc_execute($stmt,$args,);
    
'<br/>';
    
$userUID odbc_result($stmt,'UserUID');
    
    
$sql "SELECT Country FROM PS_GameData.dbo.UserMaxGrow WHERE UserUID = ?";
    
$stmt odbc_prepare($GLOBALS['dbConn'],$sql);
    
$args = array($userUID);
    
odbc_execute($stmt,$args);
    
'<br/>';
    
$country odbc_result($stmt,'Country');
    
    if (
$country==0) {
        
$sql "UPDATE PS_GameData.dbo.UserMaxGrow
            SET Country = 1
            WHERE UserUID = ?"
;
        
$stmt odbc_prepare($GLOBALS['dbConn'],$sql);
        
$args = array($userUID );
        
odbc_execute($stmt,$args);
        echo 
$character.' was successfully factioned changed from light to fury!';
    }

    if (
$country==1) {
        
$sql "UPDATE PS_GameData.dbo.UserMaxGrow
            SET Country = 0
            WHERE UserUID = ?"
;
        
$stmt odbc_prepare($GLOBALS['dbConn'],$sql);
        
$args = array($userUID );
        
odbc_execute($stmt,$args);
        echo 
$character.' was successfully factioned changed from fury to light!';
    }

    
odbc_close($GLOBALS['dbConn']);
}

?>
Use a session is always better but don't forget to start it else won't work:
PHP Code:
if (session_id() == ""){
    
session_start();

after you can check your SESSION:
PHP Code:
if(!isset($_SESSION['UserUID'])){
header('location: login.php');
exit();
    }else{
        
$uid $_SESSION['UserUID'];

A secure and nice login form is gived by castor in 'Web Service Tutorial'.

Another suggestion is move the html side after the php code, and the <? echo $account; ?> before that you declare the variable will in any case not work. also <? echo $_POST['accaunt']; ?>

during the code php is more nice if you use variables instead use echo.
example:
Code:
begin:
$newfaction = '';
in code:
$newfaction  = $character.' was successfully factioned changed from light to fury!';
in html:
<p><? echo $newfaction; ?></p>
or as i like more when have many variables in html code:
<?
echo '
<html>
<body>
<p>'.$newfaction.'</p>
</body>
</html>
';
?>
Else than this i cannot help you, because I don't use ODBC but PDO, anyway goodluck.
beetols is offline  
Thanks
1 User
Old 10/31/2015, 15:57   #17

 
DevilOfSun's Avatar
 
elite*gold: 129
Join Date: Jun 2014
Posts: 65
Received Thanks: 39
Thank you all, atm i work on a database, that work will finish today than i will take a look back at the ucp ^^
DevilOfSun is offline  
Old 10/31/2015, 21:21   #18
 
SugarD-x's Avatar
 
elite*gold: 0
Join Date: Oct 2015
Posts: 23
Received Thanks: 7
I may be wrong on this as I haven't looked very carefully at it, but I believe you may be causing a web validation error in your HTML code with the following comment:
Code:
-- Script From [DEV]Viro
If my memory serves me correctly, (it has been a long day, so again, I may be wrong here), it should be written like this:
Code:
<!-- Script From [DEV]Viro -->
SugarD-x is offline  
Reply

Tags
control panel, panel, shaiya, user


Similar Threads Similar Threads
[Selling] User Control Panel [S] E*G
09/22/2014 - elite*gold Trading - 0 Replies
Ordnerstruktur: http://i.epvpimg.com/ZaTIb.png Screens: http://i.epvpimg.com/8vQfc.png http://i.epvpimg.com/sVVhe.png http://i.epvpimg.com/Wr0wf.png http://i.epvpimg.com/af6rd.png http://i.epvpimg.com/j9Trh.png http://i.epvpimg.com/7tvqd.png Beschreibung: -> MySQL Improved (OOP Schreibweise)
User Control Panel Design
05/04/2013 - Artist Trading - 2 Replies
Hey Community Ich hätte ein User Control Panel zu verkaufen, das UCP geht in die Themen richtung GTA:SA, aber wen man die Render und Grafiken im Background etwas ändert kann man es auch ganz schnell und Simple für was anderes benutzen. Gemacht wurde das UCP eigentlich für mein altes Projekt wo ich im Team war, aber da der Server Leiter der Meinung war einfach alles zu verkaufen weil er Preis stimmte benötige ich das
User Control Panel
06/11/2012 - Shaiya - 2 Replies
Can some 1 pls share the shaiya user control panel ?if some1 stil have it.Ty anticipated.
[Hilfe] User Control Panel
06/29/2011 - Shaiya - 0 Replies
hallo, ich habe ein großes problem. ich habe das user control panel, aber das hat große fehler, wo bekomm ich den gefixten scrip her für das UCP ??? bitte um schnelle hilfe RaZoR elite*gold spenden
[Need Something] v15 User Control Panel
07/12/2010 - Flyff Private Server - 4 Replies
Hello, Im admin from a v15 server, I need a user cp for my site, Someone haves ?? Post it here please.



All times are GMT +1. The time now is 07:50.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.