Register for your free account! | Forgot your password?

You last visited: Today at 23:24

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

Advertisement



Help with php

Discussion on Help with php within the Dekaron Private Server forum part of the Dekaron category.

Reply
 
Old   #1
 
Josinho's Avatar
 
elite*gold: 0
Join Date: Jan 2011
Posts: 33
Received Thanks: 9
Help with php

I have a web page with login panel, it works fine but I want that when I logged show me for example how much coins I have on my account.

I have something like this on my code:

Code:
<?php

include("mssql.conf.php");

$con = mssql_connect($mssql['host'],$mssql['user'],$mssql['pass'])or die ('Ha fallado la conexión: '.mssql_error());

function quitar($mensaje)
{
    $nopermitidos = array("'",'\\','<','>',"\"");
    $mensaje = str_replace($nopermitidos, "", $mensaje);
    return $mensaje;
}
if(trim($HTTP_POST_VARS["Usuario"]) != "" && trim($HTTP_POST_VARS["Password"]) != "")
{
    // Puedes utilizar la funcion para eliminar algun caracter en especifico
    //$usuario = strtolower(quitar($HTTP_POST_VARS["usuario"]));
    //$password = $HTTP_POST_VARS["password"];
    // o puedes convertir los a su entidad HTML aplicable con htmlentities
    $usuario = strtolower(htmlentities($HTTP_POST_VARS["Usuario"], ENT_QUOTES));
    $password = $HTTP_POST_VARS["Password"];
    $result = mssql_query('SELECT user_pwd, user_id, user_no FROM account.dbo.Tbl_user WHERE user_id =\''.$usuario.'\'');
    if($row = mssql_fetch_array($result)){
        if($row["user_pwd"] == $password){
            $_SESSION["k_username"] = $row['user_id'];
            echo 'Has sido logueado correctamente '.$_SESSION['k_username'].' <p>';
                
               $result1 = mssql_query('SELECT amount, user_no FROM cash.dbo.user_cash');
            $row1 = mssql_fetch_array($result1);
                                        
            echo"<table class='innertab'>
                    
                    <tr>
                        <td align='left'><b>GH-Coins:</b></td>
                        <td align='left'><input type='text' readonly=readonly maxlength='20' value='".$row1[0]."'></td>
                    </tr>
                             
                    
                </table>";
            
                    
            echo "<br>";
            echo '<a href="index.php">Index</a></p>';
            <SCRIPT LANGUAGE="javascript">
            location.href = "index.php";
            </SCRIPT>*/
        }else{
            echo 'Password incorrecto';
        }
    }else{
        echo 'Usuario no existente en la base de datos';
    }
    mssql_free_result($result);
}else{
    echo 'Debe especificar un usuario y password';
}
mssql_close();
?>
The problem that I have is that show me the coins but only the first line for all the accounts and not show how much coins i have.
Josinho is offline  
Old 01/17/2012, 13:15   #2
 
elite*gold: 0
Join Date: Oct 2010
Posts: 71
Received Thanks: 4
This code is fail you must to make a new code or send me a Pn i can help you


Mfg Kasa
kasanukt113 is offline  
Reply




All times are GMT +1. The time now is 23:25.


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.