Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 09-23-2014, 02:50 PM
chrisjchrisj chrisjchrisj is offline
Contributing Member
 
Join Date: 04-05-10
Posts: 77
iTrader: 0 / 0%
How to make the Log-In Form disappear after succeeding

The code below logs-in successfully (from the home page) and then shows the sub-menu things on the home page.
(But it also shows the log-in Form still on the homepage). I'd like to stay on the home page (with the sub menu stuff) but just have the log-in form disappear after succeeding.

Any help will be appreciated.

Code:
<form action="../login.php" method="post" accept-charset="UTF-8" class="middletext" onsubmit="javascript:this.style.display='none';"> <p> <input type="text" size="20" name="user_name_login" id="user_name_login" value="ENTER USERNAME" style="color:#D9D9D9" style="vertical-align:middle"; onfocus="if (this.value=='ENTER USERNAME') {this.value=''; this.style.color='#696969';}" > <input type="text" size="20" name="password_login" id="password_login" value="ENTER PASSWORD" style="color:#D9D9D9" style="vertical-align:middle"; onfocus="if (this.value=='ENTER PASSWORD') {this.value=''; this.style.color='#696969';}" > <input type="hidden" name="cookie_time" value="10080" /> <img src="../themes/default/images/arrow-red.png" alt="" /><input type="submit" style="outline:grey" font-size="5px" value="[var.lang_login_now]" class="button-form2" /> <input type="hidden" name="submitted" value="yes" /> <input type="hidden" name="remember_me" value="remember_me" /> </p> </form> </div> <!--Begin Sub-Navigation. This only appears when a user is logged in.--> <div class="container1"> <div class="menu1"> <div class="sub-nav"><a href="../index.php"></a>&nbsp;<img src="../themes/default/images/arrow-red.jpg" style="vertical-align:middle" alt="" /><a href="../members/[var.user_name]"> my account</a><img src="../themes/default/images/arrow- red.jpg" style="vertical-align:middle" alt="" /> <a href="../credits.php">[var.lang_my_credits]: [var.member_credits]</font></a><img src="../themes/default/images/arrow-red.jpg" style="vertical-align:middle"><a href="../logout.php">[var.login_out]</a> <!--[onload;block=div;when [var.loggedin]=1;comm]--> </div>
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 09-24-2014, 01:19 AM
arunthomas203 arunthomas203 is offline
Contributing Member
 
Join Date: 06-24-14
Posts: 68
iTrader: 0 / 0%
Best practice will be usage of Ajax for form submission. You jQuery.hide("#element") to hide the form after submission
 
Reply With Quote
  #3  
Old 09-28-2014, 03:15 PM
chrisjchrisj chrisjchrisj is offline
Contributing Member
 
Join Date: 04-05-10
Posts: 77
iTrader: 0 / 0%
Can you please give me an example that will work with this Form?
 
Reply With Quote
  #4  
Old 09-29-2014, 02:58 AM
georgeweballey13's Avatar
georgeweballey13 georgeweballey13 is offline
Contributing Member
 
Join Date: 09-26-14
Location: athens,greece
Posts: 162
iTrader: 0 / 0%
Is this online somewhere???
To check it with firebug, and see what is not working.
 
Reply With Quote
  #5  
Old 09-29-2014, 04:51 AM
ScriptMan's Avatar
ScriptMan ScriptMan is online now
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 14,025
iTrader: 4 / 100%
Quote:
Originally Posted by chrisjchrisj View Post
The code below logs-in successfully (from the home page) and then shows the sub-menu things on the home page.
(But it also shows the log-in Form still on the homepage). I'd like to stay on the home page (with the sub menu stuff) but just have the log-in form disappear after succeeding.

If I wrote the script I would use PHP to do the following in pseudo code:

If user is logged in show the sub menu
Else show the login form

Of course following the flow of an unremarked script and inserting the correct 2 line of code and setting the login in status elsewhere can be a nightmare.
 
Reply With Quote
  #6  
Old 10-01-2014, 08:14 AM
brealmz's Avatar
brealmz brealmz is offline
Contributing Member
 
Join Date: 04-10-07
Posts: 90
iTrader: 0 / 0%
if not submitted through ajax what if hide it on php code?
<?php if(!$is_logged_in): ?><!-- display only if not logged in--//>
Your html form code here...
<?php endif;?>
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make an email form without PHP? chestter Coding Forum 9 10-10-2009 11:17 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 02:37 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC