I'm making a system and i want to add a button that if you click it.. will send some info from a div to a friend, but to be honest i dont have any idea how can i do this..
i used google to find info and i think is something like that can works
<?php if (isset($_POST['email'])) { $to = "friendemail"; $subject = "Website Info"; $email = 'email'; $message = ???div content???; $headers = "From: $email"; $sent = mail($to, $subject, $message, $headers); if ($sent) { echo "<script>alert('Email has been sent')</script>"; } else { echo "<script>alert('Sorry Cannot send this email')</script>"; } } ?>
the div sometimes contains images so i think this can help
$str=htmlspecialchars("<div>testing the div</div>", ENT_QUOTES); $message = $str; $message =htmlspecialchars_decode($orignal_msg_body);
Please help. x.x