• Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

HTML & CSS "Forgot password" code problem!

NiallM1974

New Coder
When I click Forgot assword I get "http://wwww.srtcmembers-beta.com/#". How can I make the link work on my login page?

Please see line of code and attached screenshot

HTML code!:
<div class="a"> <p>Forgot <a href="http://wwww.srtcmembers-beta.com/reset-password.htm">Password</a></p></div>
 

Attachments

  • srtc-forgot-password.jpg
    srtc-forgot-password.jpg
    156.8 KB · Views: 2
Solution
I got it fixed. It was due to an old file and had to rename a few files but it's working now except for login button which I am unable to click as there seems to be a problem with the code.

Login button code:
<input type="button" name="log" id="log" value="Login">

BGB

Coder
Staff Team
Guardian
In your code -
HTML:
<span>Remember me.</span>
<div class="a"><p>Forgot <a href="#">Password</a></p></div>
You did not mentioned the url address in href, thats why you are browsing the same page. Change to this -
HTML:
<span>Remember me.</span>
<div class="a"><p>Forgot <a href="http://www.srtcmembers-beta.com/reset-password.htm">Password</a></p></div>
I have added the absolute url link, change that to relative path.
And if you are actually using this exact code in your site, please check there are error in your html code.
 

NiallM1974

New Coder
In your code -
HTML:
<span>Remember me.</span>
<div class="a"><p>Forgot <a href="#">Password</a></p></div>
You did not mentioned the url address in href, thats why you are browsing the same page. Change to this -
HTML:
<span>Remember me.</span>
<div class="a"><p>Forgot <a href="http://www.srtcmembers-beta.com/reset-password.htm">Password</a></p></div>
I have added the absolute url link, change that to relative path.
And if you are actually using this exact code in your site, please check there are error in your html code.
Here is the full code for Login.htm:

HTML:
<!DOCTYPE html>
<html>
    <head>   
        <title>Member's Login Area</title>   
        <meta charset="utf-8">
        <link rel="stylesheet" type="text/css" href="css\style.css">   
    </head> 
    <body>   
        <h2>SRTC Member's Login Area!</h2><br>   
        <div class="login">   
            <form id="login" method="get" action="login.php">   
                <label><b>Username:     
                </b>   
                </label>   
                <input type="text" name="Uname" id="Uname" placeholder=>   
                <br><br>   
                <label>
                    <b>Password:</b>   
                </label>   
                <input type="password" name="Pass" id="Pass" placeholder="">   
                <br><br>   
                <input type="button" name="log" id="log" value="Login">   
                <br><br>   
                <input type="checkbox" id="check">   
                <span>Remember me</span>
                <div class="a"><p>Forgot <a href="http://www.srtcmembers-beta.com/reset-password.htm">Password</a></p></div>
            </form>
        </div>   
    </body>
</html>

Same thing still happening!
 

Mutiny

Active Coder
In your form, this line may be the problem:

HTML:
<input type="text" name="Uname" id="Uname" placeholder=>

Should be:

HTML:
<input type="text" name="Uname" id="Uname" placeholder="" />

It's possible that tag being incorrect is somehow causing the browser to misinterpret the rest of your HTML code, including your link.
 

NiallM1974

New Coder
In your code -
HTML:
<span>Remember me.</span>
<div class="a"><p>Forgot <a href="#">Password</a></p></div>
You did not mentioned the url address in href, thats why you are browsing the same page. Change to this -
HTML:
<span>Remember me.</span>
<div class="a"><p>Forgot <a href="http://www.srtcmembers-beta.com/reset-password.htm">Password</a></p></div>
I have added the absolute url link, change that to relative path.
And if you are actually using this exact code in your site, please check there are error in your html code.
The problem seems to lie in the root address gives Image 2. Howver when I enter I get Image 1 as it should be.
 

Attachments

  • srtc-forgot-password2.jpg
    srtc-forgot-password2.jpg
    7 KB · Views: 1
  • srtc-forgot-password.jpg
    srtc-forgot-password.jpg
    3.9 KB · Views: 1
Last edited:

Mutiny

Active Coder
My guess is you have two separate files. It looks like there's an index.php file on your site:

Likely you have two versions of the form, one in index.php and one in login.htm.

You can use PHP includes so that you only have one version of the form HTML across multiple files:

 

BGB

Coder
Staff Team
Guardian
Please correct the path for the link below, make that link relative -
HTML:
<div class="a"><p>Forgot <a href="http://www.srtcmembers-beta.com/reset-password.htm">Password</a></p></div>
 

BGB

Coder
Staff Team
Guardian
Did you try to clear your cache? Whenever you change your code always force refresh your browser so that it clears your cache? Else you won't see the update.
 

NiallM1974

New Coder
I got it fixed. It was due to an old file and had to rename a few files but it's working now except for login button which I am unable to click as there seems to be a problem with the code.

Login button code:
<input type="button" name="log" id="log" value="Login">
 

Attachments

  • login button.jpg
    login button.jpg
    4.3 KB · Views: 2
Solution

BGB

Coder
Staff Team
Guardian
Check your php code there must be some error for which input button is not working. Change this -
HTML:
<input type="submit" name="log" id="log" value="Submit">
Add required in your input type text and password -
HTML:
<input type="text" name="Uname" id="Uname" placeholder="" required>
and -
HTML:
<input type="password" name="Pass" id="Pass" placeholder="" required>
 
Last edited:

NiallM1974

New Coder
Check your php code there must be some error for which input button is not working. Change this -
HTML:
<input type="submit" name="log" id="log" value="Submit">
Add required in your input type text and password -
HTML:
<input type="text" name="Uname" id="Uname" placeholder="" required>
and -
HTML:
<input type="password" name="Pass" id="Pass" placeholder="" required>
Still not working mate
 

NiallM1974

New Coder
Here's my code for the login page:
HTML:
<!DOCTYPE html> 
<html>  
<head>    
    <title>Member's Login Area</title>     
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="css\style.css">    
</head>   
<body>    
    <h2>SRTC Member's Login Area!</h2><br>    
    <div class="login">    
        <form id="login" method="get" action="login.php">    
            <label><b>Username:      
            </b>    
            </label>    
            <input type="text" name="Uname" id="Uname" placeholder="" required>    
            <br><br>    
            <label><b>Password:      
            </b>    
            </label>    
            <input type="password" name="Pass" id="Pass" placeholder="" required>    
            <br><br>    
            <button type="button" name="log" id="log" value="Login">     
            <br><br>    
            <input type="checkbox" id="check">    
            <span>Remember me</span>
            <div class="a"><p>Forgot <a href="reset-password.htm">Password</a></p></div>
        </form>  
    </div>    
</body>  
  
</html>
 
Last edited:

Top