h8ids
06-02-2006, 08:53 PM
I have a button whose value changes upon being clicked.
Want to add a reference to a function.
The function will reside on the same page and send a HTML email.
<?php
function sendEmail(){
session_start();
//EMAIL BEGIN
$to = 'someone@somewhere.net';
$subject = 'Record Submitted';
$message = ' HTML formated email response<BR>All information submitted will be kept, ahem, confidential.<BR>
View the new record <a href=http://152.97.20.194/view.php?Records='.$Records.'>here</a> to view record.';
//MIME
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail($to, $subject, $message, $headers);
header("Location: viewdb4.php");
}
?>
In the following code, I need to call the function sendEmail()
<input type='button' value='Submit' onclick=(value='Submitted') title='Submit for review' style='text-decoration: none' >
I have tried this:
<input type='button' value='Submit' onclick=(value='Submitted' && emailSend()) title='Submit for review' style='text-decoration: none' >
Received the following error:
missing ) in parenthetical
viewdb4.php (line 1)
(value='Submitted'
Want to add a reference to a function.
The function will reside on the same page and send a HTML email.
<?php
function sendEmail(){
session_start();
//EMAIL BEGIN
$to = 'someone@somewhere.net';
$subject = 'Record Submitted';
$message = ' HTML formated email response<BR>All information submitted will be kept, ahem, confidential.<BR>
View the new record <a href=http://152.97.20.194/view.php?Records='.$Records.'>here</a> to view record.';
//MIME
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail($to, $subject, $message, $headers);
header("Location: viewdb4.php");
}
?>
In the following code, I need to call the function sendEmail()
<input type='button' value='Submit' onclick=(value='Submitted') title='Submit for review' style='text-decoration: none' >
I have tried this:
<input type='button' value='Submit' onclick=(value='Submitted' && emailSend()) title='Submit for review' style='text-decoration: none' >
Received the following error:
missing ) in parenthetical
viewdb4.php (line 1)
(value='Submitted'