Jump to content
Old threads will finally start getting archived Γ—
🚨🚨 GAME-CHANGING ANNOUNCEMENT FROM PHP FREAKS 🚨🚨 Γ—

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");
 
?>    
 

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.

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 !

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.

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.

                <input size="30"  placeholder="email adress"  name="sendmepass"  type="email"/>

                                  

                                  

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

 

 

 

Still doesnΒ΄t work :-(

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
  On 8/13/2016 at 7:56 PM, Pikachu2000 said:

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
  • 2 weeks later...
<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...

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.