Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/10/2015, 01:19
javierconesa23
 
Fecha de Ingreso: febrero-2011
Ubicación: Barcelona
Mensajes: 195
Antigüedad: 13 años, 2 meses
Puntos: 1
Crear Sesion en PHP

hOLA BUENAS HE CRELADO UNA CAJA DE LOGIN COMO ESTA :
Código PHP:
<!DOCTYPE html>
<
html lang="es">
<
head>
    <
meta charset="UTF-8">
    <
title>Formulario Login</title>
    <
meta name="viewport" content="width=device-width, initial-scale=1">
    <
link rel="stylesheet" type="text/css" href="css/bootstrap.css">
 
<
style>
 
body {
  
padding-top40px;
  
padding-bottom40px;
  
}
 
.
login {
  
max-width330px;
  
padding15px;
  
margin0 auto;
 
}
 
#sha{
    
max-width340px;
    -
webkit-box-shadow0px 0px 18px 0px rgba(4850500.48);
    -
moz-box-shadow:    0px 0px 18px 0px rgba(4850500.48);
    
box-shadow:         0px 0px 18px 0px rgba(4850500.48);
    
border-radius6%;
  }
 
#avatar{
width97px;
height55px;
margin: -50px auto 10px;
displayblock;
 } 
 
</
style>
    
 
</
head>
<
body>    
    
    <
div class="container well" id="sha">
        <
div class="row">
                    <
div class="col-xs-12">
                        <
img src="img/logo.png" class="img-responsive" id="avatar">
                    </
div>
        </
div>
 
        <
form class="login" action="check.php" method="POST">
                <
div class="form-group">
                    <
input type="email" class="form-control" placeholder="Usuario" name="user" required autofocus>
                </
div>
                
 
                <
div class="form-group">
                    <
input type="password" class="form-control" placeholder="Contraseña" name="pass" required>
                </
div>
 
 
                <
button class="btn btn-lg btn-primary btn-block" type="submit">iniciar sesión</button>
 
                <
div class="checkbox">
                            
                    <
label class="checkbox">
                        <
input type="checkbox" value="1" name="remember"No cerrar sesión
                    
</label>
                       <
class="help-block"><a href="#">¿No puedes acceder a tu cuenta?</a></p>
                </
div>
 
        </
form>
 
        
        
    </
div>
 
 
    <
script src="js/jquery-1.11.1.min.js"></script>
    <script src="js/bootstrap.js"></script>
</body>
</htm 


lA CUAL CUANDO SE CONECTA A UN WEBSERVICE CON UN UN USUARIO DE WINDOES Y UN ,LOGIN DE LA PAPLICACION DEL WEBSERVICE:
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="is-IS">

<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>NAV Web Service via PHP</title>
</head>
<body>

<?php

define
('USERPWD','128.20.1.1\jconesa:jconesa'); // Sustituir xxx por la contraseña del servidor 
include("NTLMStream.php");  
include(
"NTLMSoapClient.php");
 
stream_wrapper_unregister('http');
stream_wrapper_register('http','NTLMStream') or die("Fallo al registrar protocolo");
$pageURL =  'http://128.20.1.1:7047/DynamicsNav/WS/1%20TPS-N_LAB/Codeunit/WSTrucksAut'// El Web Service 
$params = array();
$params["user"] = "JCONESA"// param1 es el nombre el primer parámetro.
$params["password"] = "123545";
$client = new NTLMSoapClient($pageURL);
stream_wrapper_restore('http');
$result $client->LoginCheck($params); // El método del Web Service 
$numped $result->return_value;
echo 
'CONEXION REALIZADA CON EXITO: '.$numped;
die();

?>


</body>
</html>

Lo que necesito ahora es cambiar el login para que cuando se conecte , cree una sesion en el servidor para poder seguir programando y que no tenga que estar a cada paso dandole todos los dator del server de windows y del erp.

Gracias de antemano