Help with php

01/16/2012 17:34 Josinho#1
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.
01/17/2012 13:15 kasanukt113#2
This code is fail you must to make a new code or send me a Pn i can help you


Mfg Kasa