Foros del Web » Programando para Internet » PHP »

Una Mano Con QapTcha-master

Estas en el tema de Una Mano Con QapTcha-master en el foro de PHP en Foros del Web. Hola amigos lo que quiero hacer es algo parecido a esto http://www.webexperto.com/articulos/php/proteger-paginas-con-password-en-php-89/ http://www.supertutoriales.com/web-334.html pero con QapTcha-master ya que solo me recoge nombre y apellido y ...
  #1 (permalink)  
Antiguo 07/05/2013, 09:27
Avatar de kEvIn_Df  
Fecha de Ingreso: abril-2013
Ubicación: Cali
Mensajes: 5
Antigüedad: 11 años
Puntos: 0
Una Mano Con QapTcha-master

Hola amigos lo que quiero hacer es algo parecido a esto
http://www.webexperto.com/articulos/php/proteger-paginas-con-password-en-php-89/
http://www.supertutoriales.com/web-334.html
pero con QapTcha-master ya que solo me recoge nombre y apellido y se muy poco de este tema :(
Código:
<?php
	session_start();
	if(isset($_POST['changeOption']))
	{
		$disabledSubmit = $_POST['disabledSubmit'];
		if($disabledSubmit == 1) $js = 'disabledSubmit:true';
		else $js = 'disabledSubmit:false';
		
		$autoRevert = $_POST['autoRevert'];
		if($autoRevert == 1) $js .= ',autoRevert:true';
		else $js .= ',autoRevert:false';
		
		$autoSubmit = $_POST['autoSubmit'];
		if($autoSubmit == 1) $js .= ',autoSubmit:true';
		else $js .= ',autoSubmit:false';
	}
	else
	{
		$disabledSubmit = 2;
		$autoRevert = 1;
		$autoSubmit = 2;
		$js = 'disabledSubmit:false,autoRevert:true,autoSubmit:false';
	}
?>
<!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">
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="shortcut icon" href="favicon.ico" />
	

	
	<link rel="stylesheet" href="jquery/QapTcha.jquery.css" type="text/css" />
	
	<style type="text/css">
		form{margin:30px;width:300px}
		label{float:left;clear:both;width:100px;margin-top:10px}
		select, input{float:left;margin-top:10px}
		label.large{width:150px}
		.clr{clear:both}
		.notice {background-color:#d8e6fc;color:#35517c;border:1px solid #a7c3f0;padding:10px;margin-top:10px;}
		
		.code {
			margin:30px;
			border:1px solid #F0F0F0;
			background-color:#F8F8F8;
			padding:10px;
			color:#777;
		}
	</style>
</head>
<body>


<h1>QapTcha plugin</h1>

<?php

	// if form is submit
	if(isset($_POST['submit']))
	{
		$response = '<div class="notice">';
		
		/** SESSION CONTROL **/
		if(isset($_SESSION['qaptcha_key']) && !empty($_SESSION['qaptcha_key']))
		{
			$QaptChaInput = $_SESSION['qaptcha_key']; 
			
			/** we can control the random input grace to the QapTchaToTest intpu value **/
			if(isset($_POST[''.$QaptChaInput.'']) && empty($_POST[''.$QaptChaInput.'']))
				$response .= 'Form can be submited<br />First Name : '.$_POST['firstname'].'<br />Last Name : '.$_POST['lastname'];
			else
				$response .= '$_POST not empty or unexists';
		}
		else
			$response .= 'No SESSION.. Form can not be submitted...';
			
			
		$response .= '</div>';
		echo $response;
		
		/** Unset SESSION in all cases **/
		unset($_SESSION['qaptcha_key']);
	}
?>

<form method="post" action="">
	<fieldset>
		<label>First Name</label> <input type="text" name="firstname" />
		<label>Last Name</label> <input type="text" name="lastname" />
		<div class="clr"></div>
		
		<div class="QapTcha"></div>
		<input type="submit" name="submit" value="Submit form" />
	</fieldset>
</form>


<script type="text/javascript" src="jquery/jquery.js"></script>
<script type="text/javascript" src="jquery/jquery-ui.js"></script>
<script type="text/javascript" src="jquery/jquery.ui.touch.js"></script>
<script type="text/javascript" src="jquery/QapTcha.jquery.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$('.QapTcha').QapTcha({<?php echo $js;?>});
	});
</script>

</body>
</html>
aqui la demo
http://demos.myjqueryplugins.com/qaptcha/

Ojala alguien pueda ayudarme
Saludos
  #2 (permalink)  
Antiguo 08/05/2013, 01:00
Avatar de repara2  
Fecha de Ingreso: septiembre-2010
Ubicación: München
Mensajes: 2.445
Antigüedad: 13 años, 7 meses
Puntos: 331
Respuesta: Una Mano Con QapTcha-master

Si no sabes mucho de este tema es difícil que puedas implementar un librería de terceros. Puedes empezar por consultar la documentación de la propia librería.
Como segunda opción puedes hacerlo con funciones de PHP sin librerías externas, por ejemplo:

Código PHP:
Ver original
  1. <?php
  2. $user = $_POST['user'];
  3. $pass = $_POST['pass'];
  4.  
  5. if($user == "admin"
  6. && $pass == "admin")
  7. {
  8.         include("secure.html");
  9. }
  10. if(isset($_POST))
  11. {?>
  12.  
  13.         <form method="POST" action="secure.php">
  14.         User <input type="TEXT" name="user"></input>
  15.         Pass <input type="TEXT" name="pass"></input>
  16.         <input type="submit" name="submit"></input>
  17.         </form>
  18. <?}
  19. ?>
http://stackoverflow.com/questions/4...otect-php-page

Salu2
__________________
Fere libenter homines, id quod volunt, credunt.

Etiquetas: html, mano, select
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:50.