• Dear Guest, and welcome to RailUK Forums. Our non-railway discussion forums are currently restricted until members have five or more posts, and you will not be able to make a new thread or reply to an existing one in this section until you have made five or more posts elsewhere on the forum.

Form help?

Status
Not open for further replies.

Dave A

Established Member
Joined
7 Jun 2005
Messages
1,161
Wondering if anyone here could help.

I've got two forms, the same page but in different cells. One is a login form, the other a search form. For some reason every time I submit the login form, it directs to the search form? Cany anyone help me?

Search form:

Code:
<FORM METHOD="GET" ACTION="/search/search.php" name="Search">
Search<INPUT NAME="q" TYPE="text" class="searchform" id="searchform">
<INPUT TYPE="submit" VALUE="Go" class="searchbutton" id="searchbutton">

Login Form:

Code:
<form action="/login.php" method="POST" name="Login">
<input type="text" name="username"><br />
<input type="password" name="password"><br />
<input type="submit" value="login" name="login">

Also, while I'm on the subject, does anyone know how to make a log in form dissapear, after the form has been submitted?

Thanks in advance :)

P.S. No comments pls about how messy it is ;)
 
Sponsor Post - registered members do not see these adverts; click here to register, or click here to log in
R

RailUK Forums

T

Tom

Guest
Not done forms for a while, but you haven't closed the </form> to the search.
 

Dave A

Established Member
Joined
7 Jun 2005
Messages
1,161
Oh dear... How embarassing... I feel like a complete and utter wally :confused: :boxing: :sleepy3:

Thanks :D
Edited (by doublepost prevention system):
OK, I have searched for a solution for hours and to no avail. What I'm trying to do now is get the form to redirect back to the page I used log in, as at the moment, its going to the default page on the forum (sharing the database), as its set to do.

HTML:
<form action="/forums/login.php" method="post"><table>
<tr><td><input type="text" class="loginbox" name="username" size="12"></td></tr>
<tr><td><input type="password" class="loginbox" name="password" size="12"></td></tr>
<tr><td><input type="submit" value="login" class="submit" name="login"></td></tr>
</table>
</form>

I'm also trying to get the logout action to stay on the same page when logging out:

PHP:
<?php
$u_login_logout = '/forums/login.'.$phpEx.'?logout=true&sid=' . $userdata['session_id'];
$logout = append_sid($u_login_logout);
?>
<div id="logoutback"> 

<span class="menulinks">     <a id="logoutbut" href="<?php echo $logout ?>">Logout</a></span>
   
<?php  
}
?>

If anyone knows any way of doing this, it would greatly be appreciated :D
 
Status
Not open for further replies.

Top