close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

forgot password server behaviour doesnt seem to work

Thread began 4/13/2017 11:22 am by Christopher West | Last modified 4/19/2017 4:47 pm by Ray Borduin | 1293 views | 5 replies |

Christopher WestCommunity Expert

forgot password server behaviour doesnt seem to work

Hi I have attached the main php file and will also show the snippet of code here.

I have an email address in database and the lookup on my forgot password page doesnt seem to find the email address entered. is there something obvious from the code that I am missing/getting wrong?

php:
<?php

if (isset($_POST["forgot"]) || isset($_POST["forgot_x"])) {
  
$CheckNew = new WA_MySQLi_Auth($ecartdb);
  
$CheckNew->Action "checknew";
  
$CheckNew->Table "users";
  
$CheckNew->addFilter("UserEmail""!=""s""".((isset($_POST["email"]))?$_POST["email"]:"")  ."");
  
$FailedRedirect "forgot-password.php?Alert=NoAccount";
  if (
function_exists("rel2abs")) $FailedRedirect $FailedRedirect?rel2abs($FailedRedirect,dirname(__FILE__)):"";
  
$CheckNew->FailRedirect $FailedRedirect;
  
$CheckNew->execute();
}
?>




<form method="post" name="forgot" class="standard" id="forgot">
<label>Email Address</label>
<input name="email" type="email" required placeholder="Please provide your email address" title="Required" tabindex="1" autocomplete="off" pattern="[^@]+@[^@]+\.[a-zA-Z]{2,6}">
<button name="forgot">Send</button>
</form>



Regards
Chris

Attached Files
forgot-password.php
Sign in to reply to this post

Ray BorduinWebAssist

Your button doesn't have a value. Try triggering off the email field instead of the button.

Sign in to reply to this post
Did this help? Tips are appreciated...

Christopher WestCommunity Expert

I tried this and doesnt work. or do i have the trigger formatting wrong?

if (isset($_POST["email"]) || isset($_POST["email_x"])) {

Sign in to reply to this post

Ray BorduinWebAssist

What part isn't working? You have the "checknew" server behavior code pasted but you are talking about the forgot password email. Can I see the whole page? There are a few working parts and the issue may be in the code you haven't provided.

Sign in to reply to this post
Did this help? Tips are appreciated...

Christopher WestCommunity Expert

Hi Ray, I did originally attach the main php file when I started this post. the file is forgot-password.php - do you not see it in the first post I made ?

Chris

Sign in to reply to this post

Ray BorduinWebAssist

I see the attachment now. I must have missed it.

I don't think you can use the "check new username" in the way you have tried. Instead just add a recordset to the page filtered by the emial address and then manually add an IF statement that redirects if the email isn't found.

You would filter where the email = the entered value and then use an IF statement like:

php:
<?php

if ($CheckRS->TotalRows == 0) {
  
header("location: forgot-password.php?Alert=NoAccount");
  die();
}
?>
Sign in to reply to this post
Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...