示例#1
0
    $textBody .= 'Address: ' . $sAddress . PHP_EOL;
    $textBody .= 'Address 2: ' . $sAddress2 . PHP_EOL;
    $textBody .= 'City: ' . $sCity . PHP_EOL;
    $textBody .= 'State: ' . $sState . PHP_EOL;
    $textBody .= 'Zip: ' . $nZip . PHP_EOL;
    $textBody .= 'Message: ' . $sComments . PHP_EOL;
    $mail->Subject = 'Website Contact Form';
    $mail->Body = $htmlBody;
    $mail->AltBody = $textBody;
    $mail->AddReplyTo($sEmail, $sFirstName . ' ' . $sLastName);
    $bSent = $mail->Send();
    if (!$bSent) {
        debug('Mail Error: ' . $mail->ErrorInfo);
        error('There was a problem trying to send you message.');
    }
    $sql = makeInsertSql('contact', $aPost);
    mysql_query($sql) or debug('Query failed: ' . mysql_error());
}
function writeHeader()
{
}
function writeContent()
{
    global $aStates, $isPost, $sFirstName, $sLastName, $sEmail, $nPhone, $sAddress, $sAddress2, $sCity, $sState, $nZip, $sComments, $bSent;
    if ($bSent) {
        echo '<p>Thank you for contacting us.</p>';
    } else {
        addField(makeInput('First Name', 'con_firstname', $sFirstName), true);
        addField(makeInput('Last Name', 'con_lastname', $sLastName), true);
        addField(makeEmail('Email Address', 'con_email', $sEmail), true);
        addField(makeInput('Telephone', 'con_phone', $nPhone, 'size="13"'));
示例#2
0
    $sAddress = $rs['use_address'];
    $sAddress2 = $rs['use_address2'];
    $sCity = $rs['use_city'];
    $sState = $rs['use_state'];
    $nZip = $rs['use_zip'];
    $bAdmin = $rs['use_admin'];
    $bActive = $rs['use_active'];
}
//If there is data posted to this page, processes it.
if ($isPost) {
    $aPost['use_phone'] = getNumbers($aPost['use_phone']);
    $aPost['use_zip'] = getNumbers($aPost['use_zip']);
    if (isset($aPost['use_id'])) {
        $sql = makeUpdateSql('users', $aPost, 'use_id = ' . $aPost['use_id']);
    } else {
        $sql = makeInsertSql('users', $aPost);
    }
    if (mysql_query($sql)) {
        success($aPost['use_name'] . ' was updated.');
        redirect('user.php');
    } else {
        error('Query failed: ' . mysql_error());
    }
}
function writeHeader()
{
}
function writeContent()
{
    global $sId, $aStates, $isPost, $sName, $sEmail, $nPhone, $sAddress, $sAddress2, $sCity, $sState, $nZip, $bAdmin, $bActive;
    if (!empty($sId)) {