Jump to content
alkanumut

forgotpass.php need to forgotpass.html code

Recommended Posts

Hi, I have forgotpass.php code. But I dont have a forgotpass.html code. I tray somethink but it's not working. I need cust html code, for the this php code. 

 

Thank you and regards.

 

 

 

<?
 
include("header.php");
 
 
 
$error = $diplay = "";
 
 
 
if(isset($_POST['sendmepass']))
 
{
 
$mem_email = $affiliater->GetEmailByUsername($_POST['affiliatername']);
 
 
 
if ($mem_email != "")
 
{
 
$newpass = generatePassword();
 
$affiliater->ReminderPassword($_POST['affiliatername'], $newpass);
 
 
 
//Send mail
 
$to = $mem_email;
 
$subject = 'Password Reminder';
 
 
 
$body = str_replace("{USERNAME}", $_POST['affiliatername'], FORGOTMAILDETAIL);
 
$body = str_replace("{NEWPASSWORD}", $newpass, $body);
 
 
 
$headers = "Content-Type: text/html; charset=iso-8859-1\n";
 
mail($to, $subject, $body, $headers);
 
$error = "Your password will be e-mailed to you at the e-mail address you registered with the system! Please check it to recovery your password";
 
$diplay = "style='display: none;'";
 
}else
 
$error = "User inactive or not exists! Please type exactly affiliatername which you used to registry";
 
}
 
 
 
$template->set_filenames(array("body" => "forgotpass.html"));
 
$template->assign_vars(array(
 
'ERROR' => $error,
 
'DIPLAY' => $diplay,
 
'USERNAME'=> "Username",
 
));
 
$template->pparse("body");
 
 
 
include("footer.php");
 
?>    
 

Share this post


Link to post
Share on other sites

What is your question? What have you tried, and what exactly “isn't working”?

 

If you want us to write the HTML markup for you, this won't happen. We can help you with specific questions, but we don't do your job.

Share this post


Link to post
Share on other sites

I tray to write html code like this, but it's not working.

 

 

<form action="forgotpass.php" method="post" >

 

                <input size="30"  placeholder="email adress" name="rmail"  type="email"/>
                                  
                                  
                <input type="submit" value="New Password" name="submit" class="button"/>

 

 

  </form>

 

 

 

I don't understand where is the problem? in the php or html ? 

 

Thank you very much !

Share this post


Link to post
Share on other sites

The form parameters don't match the target script at all.

 

Your forgotpass.php expects a “sendmepass” parameter and a “affiliatername” parameter. The former is appearently supposed to be the name of the submit button, the latter is for the username.

Share this post


Link to post
Share on other sites

You have an HTML form with a text field and a submit button, right? For some reason, you've named the text field “rmail” and the button “submit”. Those names are wrong. They have to be “sendmepass” and “affiliatername”.

 

So all you have to do is change the two names in your form.

Share this post


Link to post
Share on other sites
                <input size="30"  placeholder="email adress"  name="sendmepass"  type="email"/>

                                  

                                  

                <input type="submit" value="New Password" name="affiliatername"  class="button"/>

 

 

 

Still doesn´t work :-(

Share this post


Link to post
Share on other sites

The form field name= values look backwards to me. Just sayin' . . .

Share this post


Link to post
Share on other sites

I have tried to make sense of your code so far. Please review my embedded comments.

if(isset($_POST['sendmepass']))
{
//??*******************************************
// You checked for "sendmepass" but now you are using "affiliatername"
// value which you have NOT checked for yet???
$mem_email = $affiliater->GetEmailByUsername($_POST['affiliatername']);
if ($mem_email != "")
{
$newpass = generatePassword();
$affiliater->ReminderPassword($_POST['affiliatername'], $newpass);
//Send mail
$to = $mem_email;
$subject = 'Password Reminder';
//??*******************************************
// You are editing affiliatername here but STILL have not verified that it was provided.
$body = str_replace("{USERNAME}", $_POST['affiliatername'], FORGOTMAILDETAIL);
$body = str_replace("{NEWPASSWORD}", $newpass, $body);
//??*******************************************
// I believe you HAVE to provide a From address in the headers
$headers = "Content-Type: text/html; charset=iso-8859-1\n";
mail($to, $subject, $body, $headers);
$error = "Your password will be e-mailed to you at the e-mail address you registered with the system! Please check it to recovery your password";
$diplay = "style='display: none;'";
}
else
$error = "User inactive or not exists! Please type exactly affiliatername which you used to registry";
}
$template->set_filenames(array("body" => "forgotpass.html"));
$template->assign_vars(array
(
'ERROR' => $error,
'DIPLAY' => $diplay,
'USERNAME'=> "Username",
)
);
$template->pparse("body");
include("footer.php");
Edited by ginerjm

Share this post


Link to post
Share on other sites

The form field name= values look backwards to me. Just sayin' . . .

 

Yes. The submit button must be "sendmepass", the text field must be "affiliatername" (which is somewhat logical, I think).

Edited by Jacques1

Share this post


Link to post
Share on other sites
<form action="forgotpass.php" method="post">
 
                      
                                   
                                        <input style="opacity:0.9" class="sidelinks5" size="30" maxlength="50"  placeholder="email adress" type="email"  name="affiliatername">
                                  
                                  
                                        <input type="submit" value="New Password" name="sendmepass"  class="button">
                          
           </form>

 

This my HTML code. But,

 

 

I think so some think wrong whit the php code. But I don't know what's is the problem. I tray 1000 version but it's not work :(.

 

I hope some body can HELP me... 

 

Thank you and regards...

Share this post


Link to post
Share on other sites

Again: What does “not work” mean? Is there a problem on the page itself? Are you simply not getting any e-mail? Has the application ever sent any e-mails? Be specific! We're not sitting in front of your screen, and we cannot read your mind.

 

Your e-mails don't have a From header, the headers should be terminated with \r\n rather than \n, and you should try a plaintext mail before jumping to HTML content.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.