View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Spry Tabbed Panels in DreamWeaver CS4 Dilemma

Thread began 3/22/2009 7:08 pm by jojotoronald374823 | Last modified 3/25/2009 10:51 pm by jojotoronald374823 | 5699 views | 4 replies

jojotoronald374823

Attention: danilo Re: Spry Tabbed Panel Dilemma

Okay. I understand conceptually what you are saying. At this point in time I haven't built up enough technical expertise in PHP, though I am begging to learn. (Would you recommend a good book for me).

The form processing code is as follows:<?php
if (array_key_exists('send', $_POST)) {
//mail processing script
// remove escape characters from POST array
if (PHP_VERSION < 6 && get_magic_quotes_gpc()) {
function stripslashes_deep($value) {
$value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
return $value;
}
$_POST = array_map('stripslashes_deep', $_POST);
}

$to = 'jojotoronald@aol.com'; //use your own email address
$subject = 'Contact information for quote on job';

// list expected fields
$expected = array('name', 'business', 'addressStreet', 'city', 'state', 'zip', 'phone', 'email', 'inquire');
// set required fields
$required = array('name', 'business', 'addressStreet', 'city', 'state', 'zip', 'phone', 'email', 'inquire');
// create empty array for any missing fields
$missing = array();

// assume that there is nothing suspect
$suspect = false;

// create a pattern to locate suspect phrases
$pattern = '/Content-Type:|Bcc:|Cc:/i';

// function to check for suspect phrases
function isSuspect($val, $pattern, &$suspect) {
// if the variable is an array, loop through each element
// and pass it recursively back to the same function
if (is_array($val)) {
foreach ($val as $item) {
isSuspect($item, $pattern, $suspect);
}
}
else {
// if one of the suspect phrases is found, set Boolean to true
if (preg_match($pattern, $val)) {
$suspect = true;
}
}
}
// check the $_POST array and any subarrays for suspect content
isSuspect($_POST, $pattern, $suspect);
if ($suspect) {
$mailSent = false;
unset($missing);
} else {

// process the $_POST variables
foreach ($_POST as $key => $value) {
// assign to temporary variable and strip whitespace if not an array
$temp = is_array($value) ? $value : trim($value);
// if empty and required, add to $missing array
if (empty($temp) && in_array($key, $required)) {
array_push($missing, $key);
} elseif (in_array($key, $expected)) {
// otherwise, assign to a variable of the same name as $key
${$key} = $temp;
}
}
}
// go ahead only if not suspect and all required fields OK
if (!suspect && empty($missing)) {
//build the message
$message = "Name: $name\r\n\r\n";
$message .= "Firm's name: $business\r\n\r\n";
$message .= "Street address: $addressStreet\r\n\r\n";
$message .= "City: $city\r\n\r\n";
$message .= "State: $state\r\n\r\n";
$message .= "Zip code: $zip\r\n\r\n";
$message .= "Phone number: $phone\r\n\r\n";
$message .= "Email address: $email\r\n\r\n";
$message .= "Nature of inquiry: $inquire";

// limit line lenght to 70 characters
$message = wordwrap($message, 70);



// send it

$mailSent = mail($to, $subject, $message);
if ($mailSent) {
// $missing is no longer needed if the email is sent, so unset it
unset($missing);
}
}
}

Where and how do I set the code for $tabToShow and what would that code be. Much thanks in advance. Ronald

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...