Reputation: 133
I have a big problem! I need to track what the users are doing on my site. As a way to resolve it I crated a sendmail function in order to send me an email every time a user clicks on a button. The code is this:
<div class="buy">
<a onclick="target='_blank'" href="<?php echo $this->product['from'];?>">
<?php
// The message
$message = "A new buy";
$link = $this->product['from'];
// Send
mail('[email protected]', '@buy PRODUCT', $message, $link);
?>
<img src="http://xxx.com/data/images/xxx.jpg" alt="Comprar" />
</a>
</div>
The message I receive is
"A new buy
"
And it should look like:
"A new buy
http://www.xxxx.com"
Anyone can help me with this problem?
Upvotes: 0
Views: 158
Reputation: 2080
Just concatenate any data related to your message to your $message variable and just pass that $message variable into the mail function. For example: $message = $message." Link: ".$link
and then mail('[email protected]', $message)
Upvotes: 0
Reputation: 66
You need 2 only pass one message parameter.
$message = $message.$this->product['from'];
mail('[email protected]', '@buy PRODUCT', $message);
Upvotes: 1