Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá, amigos imasters...
Estou com problema no modal box:
Sem o modal:
http://www.freeimagehosting.net/243e5
Percebam que aparece o código de segurança
Com o modal:
http://www.freeimagehosting.net/11b87
Percebam que não aparece o código de segurança
A página do modal leva até a página de login, portanto o endereço é o mesmo.
@EDIT
Já viu iframes em HTML? pois então, é como se uma página de login em um iframe não mostra-se a imagem do código de segurança.
Esse modal é carregado via Ajax ou algo do tipo?
Creio que sim, vou mandar o código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>LightWindow Demo</title>
<!-- Meta Tags -->
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="robots" content="index, follow" />
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="css/default.css" />
<link rel="stylesheet" type="text/css" href="css/lightwindow.css" />
<!-- JavaScript -->
<script type="text/javascript" src="javascript/prototype.js"></script>
<script type="text/javascript" src="javascript/effects.js"></script>
<script type="text/javascript" src="javascript/lightwindow.js"></script>
</head>
<body>
<div class="page-top"></div>
<div class="page-body">
<p>
<a href="http://Minha pagina de login aqui" class="lightwindow page-options" params="lightwindow_type=external"><strong><span style="color: red;">NEW</span> Page Treated as External</strong> - This page is local to this domain but is placed in an iframe.</a>
</p>
</body>
</html>Preciso ver o código da página CARREGADA via ajax...
Estou usando este modal:
O NEW Page Treated as External.
A página de login é esta:
login.php
<?
session_start();
if ($_POST['username']) {
if( strtolower($_POST['code'])!= strtolower($_SESSION['texto'])){
include('header.php');
echo "<br><br>ERRO Código De Segurança... ";
exit();
}
//Comprobacion del envio del nombre de usuario y password
require('funciones.php');
$username=uc($_POST['username']);
$password=uc($_POST['password']);
if ($password==NULL) {
echo "A Senha Não Foi Enviada";require('config.php');
$query = mysql_query("SELECT username,password FROM tb_users WHERE username = '$username'") or die(mysql_error());
$data = mysql_fetch_array($query);
if($data['password'] != $password) {
echo "Login incorreto";$query = mysql_query("SELECT username,password FROM tb_users WHERE username = '$username'") or die(mysql_error());
$row = mysql_fetch_array($query);
mysql_close($con);
$nicke=$row['username'];
$passe=$row['password'];
//90 dias dura la cookie
setcookie("usNick",$nicke,time()+7776000);
setcookie("usPass",$passe,time()+7776000);
$lastlogdate=time();
$lastip = getRealIP();
require('config.php');
$querybt = "UPDATE tb_users SET lastlogdate='$lastlogdate', lastiplog='$lastip' WHERE username='$nicke'";
mysql_query($querybt) or die(mysql_error());
mysql_close($con);
?>
<META HTTP-EQUIV="REFRESH" CONTENT="0;URL=members.php">
<?
}
}
}else{
?>
<? include('header.php'); ?>
<div align="center"><div id="form">
<fieldset>
<legend>Login</legend>
<form action='login.php' method='POST'>
<table width="400" border="0" align="center">
<tr>
<td width="150" align="left"><p><label>Nome De Usuário</label></p></td>
<td width="250" align="left"><input type='text' size='15' maxlength='25' name='username' autocomplete="off"value="" tabindex="1" /></td>
</tr>
<tr>
<td width="150" align="left"><p><label>Senha</label></p></td>
<td width="250" align="left"><input type='password' size='15' maxlength='25' name='password' autocomplete="off" value="" tabindex="2" /></td>
</tr>
<tr>
<td width="150" align="left"><p><label>Código De Segurança </label></p></td>
<td width="250" align="left"><input type='text' size='3' maxlength='3' name='code' autocomplete="off" class="securitycode" value="" tabindex="3" /></td>
</tr>
<tr>
<td width="150" align="left"> </td>
<td width="250" align="left"><img src="image.php?<?php echo $res; ?>" /></td>
</tr>
<tr>
<td width="150" align="left"> </td>
<td width="250" align="right"><input type="submit" value="Enter" class="submit" tabindex="4" />
</td>
</tr>
</table>
</form>
</fieldset>
</div></div>
<?
}
?>
image.php
<?php
session_start();
// Juego de letras para usar
$letras = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
// Configuración tamaño imagen y tamaño fuente
$ancho_caja = 130;
$alto_caja = 60;
$tam_letra = 10;
$tam_letra_grande = 45;// Creamos una imagen
$im = imagecreate($ancho_caja, $alto_caja);
// Creo el color del texto, del texto del fondo y del fondo de la imagen
$gris = ImageColorAllocate($im, 247, 247, 247);
$colorLetra = ImageColorAllocate($im, 105, 159, 189);
$colorLetraFondo = ImageColorAllocate($im, 247, 247, 247);
// tipo de letra obtenido en dafont.net
$fuente = './image2.ttf';
// Calculo el número de líneas que entran
$caja_texto = imagettfbbox($tam_letra, 0, $fuente , $letras);
$alto_linea = abs($caja_texto[7]-$caja_texto[1]);
$num_lineas = intval($alto_caja / $alto_linea)+1;
// Dibujo las letras del fondo
// Cada letra de escribe de una en una para poder
// darle una rotación independiente al resto
$pos = 0;
for ($i = 0; $i<$num_lineas; $i++) {
$x = 0;
for ($j = 0; $j<30; $j++) {
$texto_linea = $letras[rand(0, strlen($letras)-1)].' ';
$caja_texto = imagettfbbox($tam_letra, 0, $fuente , $texto_linea);
imagettftext($im, $tam_letra, rand(-$angmax, $angmax), $x, $alto_linea*$i, $colorLetraFondo, $fuente , $texto_linea);
// Posicion x de la siguiente letra
$x += $caja_texto[2] - $caja_texto[0];
}
}
// Escribo las tres letras del CAPTCHA
$res = $letras[rand(0, strlen($letras)-1)];
$ang1 = rand(-$angmax, $angmax);
$caja_texto = imagettfbbox($tam_letra_grande, $ang1, $fuente , $res);
$y1 = abs($caja_texto[7]-$caja_texto[1]);
$x1 = abs($caja_texto[2]-$caja_texto[0]);
$res .= $letras[rand(0, strlen($letras)-1)];
$ang2 = rand(-$angmax, $angmax);
$caja_texto = imagettfbbox($tam_letra_grande, $ang2, $fuente , $res[1]);
$y2 = abs($caja_texto[7]-$caja_texto[1]);
$x2 = abs($caja_texto[2]-$caja_texto[0]);
$res .= $letras[rand(0, strlen($letras)-1)];
$ang3 = rand(-$angmax, $angmax);
$caja_texto = imagettfbbox($tam_letra_grande, $ang3, $fuente , $res[2]);
$y3 = abs($caja_texto[7]-$caja_texto[1]);
$x3 = abs($caja_texto[2]-$caja_texto[0]);
imagettftext($im, $tam_letra_grande, $ang1, ($ancho_caja/2)-(($x1+$x2+$x3)/2), $y1+($alto_caja-$y1)/2, $colorLetra, $fuente , $res[0]);
imagettftext($im, $tam_letra_grande, $ang2, ($ancho_caja/2)-(($x1+$x2+$x3)/2)+($x1), $y2+($alto_caja-$y2)/2, $colorLetra, $fuente , $res[1]);
imagettftext($im, $tam_letra_grande, $ang3, ($ancho_caja/2)-(($x1+$x2+$x3)/2)+($x1+$x2), $y3+($alto_caja-$y3)/2, $colorLetra, $fuente , $res[2]);
imagepng($im);
imagedestroy($im);
imagedestroy($im2);
$_SESSION["texto"] = $res;
?>
O caminho para a imagem está errado, por isso ela não aparece.
Tente utilizar caminhos absolutos para evitar problemas...