Form error

Status
Not open for further replies.

Adil

DevBest CEO
May 28, 2011
1,278
716
Title says all. I can't login with my form. I can login with my ASE form though :(
HTML:
<link rel="stylesheet" href="styles/main.css" type="text/css" />
<script type="text/javascript">
</script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js"></script>
<script type="text/javascript">
function loadUrl(location)
{
this.document.location.href = location;
}
</script>
 
<script type="text/javascript">
 
$(document).ready(function(){
$('.login').hide();
$( ".container" ).draggable(); //basic JQuery ui for dragging elements around =D
//bet no other theme has that 8-)
});
 
 
function hide_element (element, speed) {
        $(element).hide(speed); //hide function, with the parameters element, speed
}
 
function toggle_element (element, speed) {
        $(element).toggle(speed);
}/*
Basic jquery stuff, for hiding elements and dragging elements around the screen
*/
</script>
<body>
<div class="container" >
<div class="header-container">
<div class="header">Welcome to {hotelName}<img src="app/tpl/skins/Joker/styles/images/icon-logout.png" alt="exit button" align="right" style="margin-top:0;"/></div></div>
Here at {hotelName}, you can find a range of things to do...
<ul>
<li>Chat to friends</li>
<li>Host competitions</li>
<li>Build dream rooms</li>
</ul>
 
<!-- Put special offers here?!-->
<img src="app/tpl/skins/Joker/styles/images/avatar.png" alt="icushorty"/><div class="buttoncont"><div class="reg"><div class="regtop"></div><div class="buttontext">Register</div></div></div>
<br/><br/><br/><br/><!--couldn't be bothered to rewrite divs and stuff, was pretty late.!-->
<div class="buttoncont"><div class="reg" onclick="toggle_element('.login',0);"><div class="regtop"></div><div class="buttontext">Login</div></div></div>
<div class="login">
<?php if(isset($template->form->error)) { echo $template->form->error; } ?>
<form action="index" method="post">
<label for="username">Username</label>
<input type="text" id="username" name="log_user"/>
<label for="password">Password</label>
<input type="password" id="password" name="log_password"/>
<input type="submit" name="Login" value="Login" style="margin-left:2px;
border:3px solid #000;
width:100px;
height:30px;
font-family:'Verdana';
color:#fff;
background-color:#2f8415;
"/>
</form>
</div>
</div>
</body>
What's wrong with it?
 

Heaplink

Developer & Designer
Nov 9, 2011
510
173
at action it's set to action="index" - if you have a .htaccess file, look after what desination it goes to. This might also be a type where you forgot the extension.

I can't see any other errors, it works for me.
 

Adil

DevBest CEO
May 28, 2011
1,278
716
at action it's set to action="index" - if you have a .htaccess file, look after what desination it goes to. This might also be a type where you forgot the extension.

I can't see any other errors, it works for me.
Extension works. Even if I have action="index" or action="index.php", it works.
Code:
RewriteEngine On
 
RewriteRule ^(|/)$ index.php?url=$1
RewriteRule ^([a-zA-Z0-9_-]+)(|/)$ index.php?url=$1
RewriteEngine on
RewriteRule ^(.*)\.htm$ $1.php [NC]
 
RewriteRule ^(|/)$ dash.php?page=$1
RewriteRule ^([a-zA-Z0-9_-]+)(|/)$ dash.php?url=$1
Rev's .htaccess
 

Heaplink

Developer & Designer
Nov 9, 2011
510
173
The problem is that the name of both username and login button is wrong. They have to be as follows:

Username text: log_username
Password text: log_password
Login button: login
 

Adil

DevBest CEO
May 28, 2011
1,278
716
HTML:
<form action="index.php" method="post">
<label for="username">Username</label>
<input type="text" name="log_username" id="username"/>
<label for="password">Password</label>
<input type="password" name="log_password" id="password"/>
<input type="submit" name="login" value="Login" id="button"  style="margin-left:2px;
border:3px solid #000;
width:100px;
height:30px;
font-family:'Verdana';
color:#fff;
background-color:#2f8415;
"/>
</form>
Form is correct :S
 

Heaplink

Developer & Designer
Nov 9, 2011
510
173
This

<input type="text" name="log_username" id="username"/>

was this in your original source

<input type="text" name="log_user" id="username"/>

This works for me just fine:
HTML:
<form action="index" method="post">
<label for="username">Username</label>
<input type="text" name="log_username" id="username"/>
<label for="password">Password</label>
<input type="password" name="log_password" id="password"/>
<input type="submit" name="login" value="Login" id="button"  style="margin-left:2px;
border:3px solid #000;
width:100px;
height:30px;
font-family:'Verdana';
color:#fff;
background-color:#2f8415;
"/>
</form>
 
Status
Not open for further replies.

Users who are viewing this thread

Top