use url instead of hardcoded link

This commit is contained in:
Thies Mueller 2021-01-10 15:49:35 +01:00
parent 572808ec12
commit e0e6d097b4
2 changed files with 6 additions and 6 deletions

View File

@ -54,8 +54,8 @@ if(isset($_GET['send']) ) {
$mailrcpt = $user['email']; $mailrcpt = $user['email'];
$mailsubject = "Activate the Account of ".$user['username']; $mailsubject = "Activate the Account of ".$user['username'];
$from = "From: Account Activation Service <activatemyaccount@loginpagefoo.td00.de>"; //place a real address if we use this in production $from = "From: Account Activation Service <activatemyaccount@".$_SERVER['HTTP_HOST'].">"; //place a real address if we use this in production
$url_activationcode = 'https://loginpagefoo.td00.de/activate.php?userid='.$user['id'].'&code='.$activationcode; //this shouldnt be my domain in prod.. $url_activationcode = 'https://'.$_SERVER['HTTP_HOST'].'/activate.php?userid='.$user['id'].'&code='.$activationcode; //this shouldnt be my domain in prod..
$text = 'Hallo '.$user['username'].', $text = 'Hallo '.$user['username'].',
please use the following URL to activate your account in the next 24h: please use the following URL to activate your account in the next 24h:
'.$url_activationcode.' '.$url_activationcode.'
@ -64,7 +64,7 @@ If this mail comes unsolicited, please just ignore the mail.
cheers cheers
loginpagefoo script'; loginpagefoo script';
echo $url_activationcode;
mail($mailrcpt, $mailsubject, $text, $from); mail($mailrcpt, $mailsubject, $text, $from);
echo 'Link send. Going back to <a href="profile.php">profile</a> page. <meta http-equiv="refresh" content="0; URL=profile.php">'; echo 'Link send. Going back to <a href="profile.php">profile</a> page. <meta http-equiv="refresh" content="0; URL=profile.php">';

View File

@ -47,8 +47,8 @@ if(isset($_GET['send']) ) {
$mailrcpt = $user['email']; $mailrcpt = $user['email'];
$mailsubject = "New password for your User"; $mailsubject = "New password for your User";
$from = "From: Password Reset Service <resetmypw@loginpagefoo.td00.de>"; //place a real address if we use this in production $from = "From: Password Reset Service <resetmypw@".$_SERVER['HTTP_HOST'].">"; //place a real address if we use this in production
$url_passwordcode = 'https://loginpagefoo.td00.de/resetpass.php?userid='.$user['id'].'&code='.$passwordcode; //this shouldnt be my domain in prod.. $url_passwordcode = 'https://'.$_SERVER['HTTP_HOST'].'/resetpass.php?userid='.$user['id'].'&code='.$passwordcode; //this shouldnt be my domain in prod..
$text = 'Hallo '.$user['username'].', $text = 'Hallo '.$user['username'].',
please use the following URL to change your password in the next 24h: please use the following URL to change your password in the next 24h:
'.$url_passwordcode.' '.$url_passwordcode.'
@ -57,7 +57,7 @@ If this mail comes unsolicited, please just ignore the mail.
cheers cheers
loginpagefoo script'; loginpagefoo script';
echo $url_passwordcode;
mail($mailrcpt, $mailsubject, $text, $from); mail($mailrcpt, $mailsubject, $text, $from);
echo 'Link send. Going back to <a href="login.php">login</a> page. <meta http-equiv="refresh" content="0; URL=login.php">'; echo 'Link send. Going back to <a href="login.php">login</a> page. <meta http-equiv="refresh" content="0; URL=login.php">';