This topic is locked

mail buttons on list page

1/26/2009 7:13:06 AM
PHPRunner General questions
S
shoppy author

On the listpage I have two buttons for two different mails to send.

When a payment arives a click on the button wil send an email to a person that checkes the payment.

Because there a two different kind of payments I made two buttons for two different emailadresses.
But when I click one of the two buttons it sends to both of the persons.

It doesn'tmatter witch button I click, it will send an emails to both emailadresses.
fist one

[codebox]// ** Button ****

echo "<INPUT class=button type=button value=\"&nbsp;&nbsp;Betaalde Contributies&nbsp;&nbsp;\" onclick='window.location=\"_leden_list.php?editid1=".$_REQUEST["editid1"]."&mail=yes\"'>";
// ** Send simple email ****
ini_set('SMTP','post.demon.nl');

global $conn;
//****variabelen*
if ($_REQUEST["mail"]=="yes")
{
$email="shoppy@zonnet.nl";

$message="De boekhouding is bijgewerkt.";

$subject="Nieuwe betalingen binnengekomen";
mail($email, $subject, $message);
exit();[/codebox]
second one
[codebox]// ** Button ****

echo "<INPUT class=button type=button value=\"&nbsp;&nbsp;Betaalde Acties&nbsp;&nbsp;\" onclick='window.location=\"_leden_list.php?editid1=".$_REQUEST["editid1"]."&mail=yes\"'>";
// ** Send simple email ****
ini_set('SMTP','post.demon.nl');

global $conn;
//****variabelen*

if ($_REQUEST["mail"]=="yes")
{

$email="jdewinkel@winkel-advies.nl";

$message="De boekhouding is bijgewerkt.";

$subject="Nieuwe betalingen binnengekomen";
mail($email, $subject, $message);
exit();

}[/codebox]
The names of the buttons are _leden_mailbuttonand _leden_mailbutton1.
Please help
regards,
John

J
Jane 1/26/2009

John,
use different parameters in your links:

onclick='window.location=\"_leden_list.php?editid1=".$_REQUEST["editid1"]."&mail1=yes\"'


onclick='window.location=\"_leden_list.php?editid1=".$_REQUEST["editid1"]."&mail2=yes\"'

S
shoppy author 1/26/2009

John,

use different parameters in your links:


Thanks Jane,
But Also the line: if ($_REQUEST["mail"]=="yes") should be changed in 'mail1' and 'mail2'
Works fine,
regards,
John