Foros del Web » Programando para Internet » PHP »

El formulario del login no me funciona

Estas en el tema de El formulario del login no me funciona en el foro de PHP en Foros del Web. Hola chicos tengo un error con el formulario y lo que me pasa es que no envia los datos al login.php. Es decir, nose si ...
  #1 (permalink)  
Antiguo 23/02/2016, 13:21
 
Fecha de Ingreso: marzo-2014
Mensajes: 168
Antigüedad: 10 años, 1 mes
Puntos: 2
El formulario del login no me funciona

Hola chicos tengo un error con el formulario y lo que me pasa es que no envia los datos al login.php. Es decir, nose si el propio login los recibe porque ingreso mis datos y no se mueve hacia la pestaña de login.php haciendo el metodo post. ¿Alguna ayudita? ¿Alguien podria agregarme al skype para tener un contacto directo ya que tengo muchos problemas con esto? Salu2

Formulario:

Código HTML:
<form id="signup-form" method="post" action="login.php"> 
				<input type="text" name="user" id="user" placeholder="User">
                <input type="password" name="password" id="password" placeholder="Password">
				<input type="submit" value="Sign In"></form> 
Login:

Código PHP:
<?php
require_once('conexion.php');
conectar('mysql13.000webhost.com''a6612376_camara''users''a6612376_sergi');

$username strip_tags($_POST['user']); 
$password strip_tags(sha1($_POST['password'])); 
  
$query mysql_query("SELECT * FROM users WHERE user='".mysql_real_escape_string($username)."' AND pass='".mysql_real_escape_string($password)."' LIMIT 1 "); 
 
if(
$existe mysql_fetch_object($query))  
{  
  if(
$existe->activado != 1) { 
$sql "UPDATE users SET activado='1' WHERE user='$username'"
                    
mysql_query($sql) or die("Error query ".mysql_error()); 
$delete = ("DELETE FROM codigo WHERE user='$username''"); 
                    
mysql_query($sql) or die("Error query ".mysql_error());  
    echo 
'Tu cuenta ha sido activada correctamente, gracias por entender el mensaje en el registro.';
    
header("refresh: 4; url=http://ofserker.netai.net/");
}else{  
    
$_SESSION['logged'] = 'yes';  
    
$_SESSION['uid'] = $existe->uid;  
    
$_SESSION['username'] = $username
    echo 
'<script>window.location="inicio.php"</script>';  
}  
}else{  
    echo 
'El usuario y/o pass son incorrectos.';      
}
?>
  #2 (permalink)  
Antiguo 23/02/2016, 13:25
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: El formulario del login no me funciona

Cita:
¿Alguien podria agregarme al skype para tener un contacto directo ya que tengo muchos problemas con esto?
Eso va contra las normas del foro.

Cita:
y no se mueve hacia la pestaña de login.php haciendo el metodo post.
Eso es extraño porque el formulario es 100% HTML.
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #3 (permalink)  
Antiguo 23/02/2016, 13:26
 
Fecha de Ingreso: marzo-2014
Mensajes: 168
Antigüedad: 10 años, 1 mes
Puntos: 2
Respuesta: El formulario del login no me funciona

No lo entiendo, es increíble, el maldito form no funciona o algo funciona mal. ¿Qué hago?
  #4 (permalink)  
Antiguo 23/02/2016, 13:28
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: El formulario del login no me funciona

Cita:
Iniciado por OfSerker Ver Mensaje
No lo entiendo, es increíble, el maldito form no funciona o algo funciona mal. ¿Qué hago?
¿De verdad el formulario por si mismo no hace nada?

Sería bueno que expliques cómo ejecutas dichos scripts en tu navegador, porque de pronto es complicado adivinar si haces bien las cosas o no.
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #5 (permalink)  
Antiguo 23/02/2016, 13:30
 
Fecha de Ingreso: marzo-2014
Mensajes: 168
Antigüedad: 10 años, 1 mes
Puntos: 2
Respuesta: El formulario del login no me funciona

Me descargué el formulario de una página de html 5. Si quieres comprobar tu mismamente cómo funciona el form. Pues metete en la página dónde estoy trabajando: http://issergizz.net23.net/ . El form te juro que no funciona.
  #6 (permalink)  
Antiguo 23/02/2016, 13:33
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: El formulario del login no me funciona

Pues el tema es que dicho formulario usa Javascript, y sin entender lo que hace pues ¿cómo adivinar?

Es más, si desactivas el Javascript en tu formulario todo debería fluir como siempre.
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #7 (permalink)  
Antiguo 23/02/2016, 13:35
 
Fecha de Ingreso: marzo-2014
Mensajes: 168
Antigüedad: 10 años, 1 mes
Puntos: 2
Respuesta: El formulario del login no me funciona

main.js

Código:
/*
	Eventually by HTML5 UP
	html5up.net | @n33co
	Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
*/

(function() {

	"use strict";

	// Methods/polyfills.

		// classList | (c) @remy | github.com/remy/polyfills | rem.mit-license.org
			!function(){function t(t){this.el=t;for(var n=t.className.replace(/^\s+|\s+$/g,"").split(/\s+/),i=0;i<n.length;i++)e.call(this,n[i])}function n(t,n,i){Object.defineProperty?Object.defineProperty(t,n,{get:i}):t.__defineGetter__(n,i)}if(!("undefined"==typeof window.Element||"classList"in document.documentElement)){var i=Array.prototype,e=i.push,s=i.splice,o=i.join;t.prototype={add:function(t){this.contains(t)||(e.call(this,t),this.el.className=this.toString())},contains:function(t){return-1!=this.el.className.indexOf(t)},item:function(t){return this[t]||null},remove:function(t){if(this.contains(t)){for(var n=0;n<this.length&&this[n]!=t;n++);s.call(this,n,1),this.el.className=this.toString()}},toString:function(){return o.call(this," ")},toggle:function(t){return this.contains(t)?this.remove(t):this.add(t),this.contains(t)}},window.DOMTokenList=t,n(Element.prototype,"classList",function(){return new t(this)})}}();

		// canUse
			window.canUse=function(p){if(!window._canUse)window._canUse=document.createElement("div");var e=window._canUse.style,up=p.charAt(0).toUpperCase()+p.slice(1);return p in e||"Moz"+up in e||"Webkit"+up in e||"O"+up in e||"ms"+up in e};

		// window.addEventListener
			(function(){if("addEventListener"in window)return;window.addEventListener=function(type,f){window.attachEvent("on"+type,f)}})();

	// Vars.
		var	$body = document.querySelector('body');

	// Disable animations/transitions until everything's loaded.
		$body.classList.add('is-loading');

		window.addEventListener('load', function() {
			window.setTimeout(function() {
				$body.classList.remove('is-loading');
			}, 100);
		});

	// Slideshow Background.
		(function() {

			// Settings.
				var settings = {

					// Images (in the format of 'url': 'alignment').
						images: {
							'images/bg01.jpg': 'center',
							'images/bg02.jpg': 'center',
							'images/bg03.jpg': 'center'
						},

					// Delay.
						delay: 6000

				};

			// Vars.
				var	pos = 0, lastPos = 0,
					$wrapper, $bgs = [], $bg,
					k, v;

			// Create BG wrapper, BGs.
				$wrapper = document.createElement('div');
					$wrapper.id = 'bg';
					$body.appendChild($wrapper);

				for (k in settings.images) {

					// Create BG.
						$bg = document.createElement('div');
							$bg.style.backgroundImage = 'url("' + k + '")';
							$bg.style.backgroundPosition = settings.images[k];
							$wrapper.appendChild($bg);

					// Add it to array.
						$bgs.push($bg);

				}

			// Main loop.
				$bgs[pos].classList.add('visible');
				$bgs[pos].classList.add('top');

				// Bail if we only have a single BG or the client doesn't support transitions.
					if ($bgs.length == 1
					||	!canUse('transition'))
						return;

				window.setInterval(function() {

					lastPos = pos;
					pos++;

					// Wrap to beginning if necessary.
						if (pos >= $bgs.length)
							pos = 0;

					// Swap top images.
						$bgs[lastPos].classList.remove('top');
						$bgs[pos].classList.add('visible');
						$bgs[pos].classList.add('top');

					// Hide last image after a short delay.
						window.setTimeout(function() {
							$bgs[lastPos].classList.remove('visible');
						}, settings.delay / 2);

				}, settings.delay);

		})();

	// Signup Form.
		(function() {

			// Vars.
				var $form = document.querySelectorAll('#signup-form')[0],
					$submit = document.querySelectorAll('#signup-form input[type="submit"]')[0],
					$message;

			// Bail if addEventListener isn't supported.
				if (!('addEventListener' in $form))
					return;

			// Message.
				$message = document.createElement('span');
					$message.classList.add('message');
					$form.appendChild($message);

				$message._show = function(type, text) {

					$message.innerHTML = text;
					$message.classList.add(type);
					$message.classList.add('visible');

					window.setTimeout(function() {
						$message._hide();
					}, 3000);

				};

				$message._hide = function() {
					$message.classList.remove('visible');
				};

			// Events.
			// Note: If you're *not* using AJAX, get rid of this event listener.
				$form.addEventListener('submit', function(event) {

					event.stopPropagation();
					event.preventDefault();

					// Hide message.
						$message._hide();

					// Disable submit.
						$submit.disabled = true;

					// Process form.
					// Note: Doesn't actually do anything yet (other than report back with a "thank you"),
					// but there's enough here to piece together a working AJAX submission call that does.
						window.setTimeout(function() {

							// Reset form.
								$form.reset();

							// Enable submit.
								$submit.disabled = false;

							// Show message.
								$message._show('success', 'Thank you!');
								//$message._show('failure', 'Something went wrong. Please try again.');

						}, 750);

				});

		})();

})();
  #8 (permalink)  
Antiguo 23/02/2016, 13:40
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: El formulario del login no me funciona

Creo que no me entendiste, si tu problema es Javascript entonces debiste preguntar en el foro de Javascript.

Básicamente el HTML y el script PHP son tan simples que dudo que no sirvan.

Si lees los comentarios del código:
Cita:
// Note: Doesn't actually do anything yet (other than report back with a "thank you"),
// but there's enough here to piece together a working AJAX submission call that does.
Ahí tienes la razón del porque no te funciona como esperas.
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.

Etiquetas: formulario, login, mysql, select, sql, variable
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 05:44.