1
I’ve had a problem for two days that I can’t decipher. I need the login and password variable passed in my system login form, to reach the url that receives the user and password parameter. This way it will enter according to the login and password passed in the login. This is the code that receives the data from the database:
session_start(); // Inicia a session
include "./conexao.php";
$login = $_POST['login'];
$senha = $_POST['senha'];
if ((!$login) || (!$senha)){
echo"<script language='javascript' type='text/javascript'>alert('Por favor, todos campos devem ser preenchidos!');window.location.href='login.php';</script>";
}else{
$sql = pg_query("...");
$login_check = pg_num_rows($sql);
if ($login_check<=0){
echo"<script language='javascript' type='text/javascript'>alert('Login e/ou senha incorretos');window.location.href='login.php';</script>";
die();
}else{
@session_start();
$_SESSION['login'] = $login;
$_SESSION['senha'] = $senha;
$arr = pg_fetch_array($sql);
$_SESSION['nome'] = $arr['usr_nome'];
//setcookie("login",$login);
header("Location:index.php");
}
}
Then I need to send the data to this link here:
<div class="thumbnail">
<img src="../05fev/imagens/unnamed.png" alt="Imagem responsiva" class="img-rounded"/>
<div id="main" class="caption">
<Iframe
src = "http://desenv.../webrun/logon.do?sys=SER&user=(aqui recebe o login)&password=(aqui recebe a senha)">
</iframe>
</div>
</div>
Someone can help me ??
Sending user and password through the URL is a unsafe practice, would make a request with POST.
– Giancarlo Abel Giulian
true, but how would that be ? given that it is an external url attached to the system ?
– Bruno Henrique Gaignoux Gomes
Your html and php are in the same file?
– KhaosDoctor
are in the same place
– Bruno Henrique Gaignoux Gomes
@Brunohenriquegaignouxgomes If you need a tutorial, here’s a good example: http://www.wikihow.com/Create-a-Secure-Login-Script-in-PHP-and-MySQL
– helderk