...next week we think.
The founders of the course have approved the site "Your website looks great - clear, accurate, inviting."
Permissions have come back from all the sites we link to - only one said they had to hold a meeting :rolleyes: so their links have been removed.
Now...what do you lot say? What have I forgotten, what should I change?
I know I have to do a sitemap and redo the header and footer bg. Speaking of the header - it is soooo slow to come in and sometimes it doesn't appear at all. This is not good, what's causing it please?
Link?
Link?
I did remember when I got to
I did remember when I got to bed :rolleyes: I also made text edits to nearly every page last night and haven't run them all through the validator yet.
Quick point, on the
Quick point, on the Aboriginal page the images in the sidebar are not centered esp so the white background magazine front, you will need to counter the padding you applied to #sidebar p{} and bear in mind that your rules for .image2 are of a lower weight and will need bumping up i.e adding #sidebar to the selector.
tn_amhfa-culturally-competent.png this ia a very large file size and takes a while to render can you not try saving as a gif or jpg? while retaining the required quality? failing that does this need to be a graphic? can't you simply style a ul list?
Two less important
Two less important points:
"Copyright © 2008" and too many keywords. Google ignores keywords (this is what it looks like)
other engines may care about 8 to 10. Really less important. If you´re able to use php and as it seems you are, use the little snippet and you´ll never have to change the year manually.
Copyright © <?php echo date("Y"); ?>
Hugo - Yes I was aware that
Hugo - Yes I was aware that the Mensline poster was not centring but was at a bit of a loss as to why until I worked out it was the padding, so thanks for the hint on that. I'll also see what I can do about the the culturally-competent file.
"Copyright © 2008" and too many keywords. Google ignores keywords (this is what it looks like)
other engines may care about 8 to 10. Really less important. If you´re able to use php and as it seems you are, use the little snippet and you´ll never have to change the year manually.
Ah thanks for the snippet and I did realise that I had both Copyright and the logo there and ideally it should be one or the other. One thing occurs to me - shouldn't the copyright year be the either the earliest it is written or at least the span of years from earliest to current? As in 2008-2009? Which is actually correct use for the internet?
I won't be able to get back to this until tomorrow but thank you both for all those hints.
I don´t know if the
I don´t know if the copyright-information is really necessary. Under our german law the internetsite
is covered by the author´s rights from the moment of it´s publication. But that´s the point. To have a right is just one side of the medal.
So, i write both. "copyright" and the sign and mean: keep yours fingers off!!! But realisticly
you won´t put the fear of God into somebody who lives in ... where the appropriate authorities
don´t even know what the sense of "copyright" could be.
You're quite right of course
You're quite right of course Crea - a copyright notice isn't going to stop anyone really, but thanks for the snippet anyway
Copyright ©
Copyright © 2008-<?php echo date("Y"); ?>
@Josh - sorry for the late
@Josh - sorry for the late reply but thanks for the "improved snippet"
Okay. New problem. Today I was able to view the site on Vista with IE7 and there seemed to be a problem with the menu. When hovering over an item that has a drop down, they showed but didn't collapse/retract again when you moved off the item.
Could/would someone please confirm this for me?
ETA: I think the bottom falls out of the wrapper too.
Can't see any problems; drop
Can't see any problems; drop downs work fine, see no float containment problems IE7 Vista
Thanks Hugo - don't know
Thanks Hugo - don't know what the problem was then, it was definitely skewed today at work :shrug:
Well it's up Even the
Even the verify code in the contact form is back. I finally figured that because I had changed the path for the formailer it wouldn't show till I put it on the site duh!
I got analytics in but didn't get to all the bits in this thread so still have to get to them, but the pressure was on to get it operational.
The only amiss thing is that my favicon doesn't show in the browser tab :? I haven't fiddled with that at all.
<link rel="shortcut icon" type="image/x-icon" href="msavers.ico">
Quote:Even the verify code
Even the verify code in the contact form is back. I finally figured that because I had changed the path for the formailer it wouldn't show till I put it on the site duh!
:rolleyes:
Erm the favicon shows fine, so is probably a caching issue, try clearing your cache.
Quote:Erm the favicon shows
Erm the favicon shows fine, so is probably a caching issue, try clearing your cache.
Ummm...no, still not there. But if you say it is I'd believe you over me any day, so I'll stop worrying about it - unless of course it's your caching issue
Another point...I validated every page the other day and the only thing left is 7 warnings because of 'created' XHTML space/> by Dagon (when you view source on the Contact page). I really need to put ticks on this site - what can I do?
You just need to go through
You just need to go through the main file generating the form controls and remove the closing slash, if not sure post the files, and we can point out where to edit.
hunted down your old thread
hunted down your old thread on the dragon script, it looks as though it's this file
dd-formmailer.php
look for the gen =. /> lines these are the closing parts of the input controls so remove the '/'
Thank you Hugo -
Thank you Hugo - unfortunately I ran out of time tonight and now won't be able to get back to it till the weekend.
A quick look shows I'm probably going to need help to find them though and yes that is the right file
Hang pn a bit - I lost the
Hang on a bit - I lost the thread - will post the file in a bit for some help in finding the culprits please.
<?php /* ** Dagon Design Form Mailer ** ** Version 5.33 ** ** <a href="http://www.dagondesign.com/articles/secure-php-form-mailer-script/ ** **" rel="nofollow">http://www.dagondesign.com/articles/secure-php-form-mailer-script/ ** **</a> A basic explanation of each option can be found below. For full documentation, ** including advanced usage, updates, and more, please visit the web site. ** */ /* ** START OF OPTIONS */ // STANDALONE OPTION // If you plan to use this script by itself (not included from another PHP file), set this // option to TRUE, and it will generate a proper html header and footer. If you want to // change the basic header and footer, they are found near the bottom of this script $standalone = FALSE; // If you are using the standalone option, enter the relative path to your CSS file so it // can be declared properly in the header $path_to_css = 'phpincludes/dd-formmailer/dd-formmailer.css'; // For those of you including this script in another PHP file, be sure to manually // add the CSS declaration in the header section of your page: // <link rel="stylesheet" href="(location of dd-formmailer.css)" type="text/css" media="screen"> // LANGUAGE SETTING // The relative path to the language file you want to use. $language = 'phpincludes/dd-formmailer/lang/English.php'; // FULL URL TO SCRIPT // The full URL to dd-formmailer.php (or whatever you have renamed it to) $script_path = 'http://www.mindsavers.com.au/phpincludes/dd-formmailer/dd-formmailer.php'; // FULL URL TO CONTACT PAGE // If you are running this script in standalone mode, leave this blank. Otherwise, // enter the full URL to the page that is displaying the form $path_contact_page = 'http://www.mindsavers.com.au/contactdeb.php'; // RECIPIENT DATA // If you are just sending email to a single address, enter it here. For more advanced // usage such as multiple recipients, CC, BCC, etc.. please see the web page for instructions $recipients = '[email protected]|[email protected]'; // FORM STRUCTURE // This is used to generate the form. Each form element must be on its own line. // Detailed usage instructions can be found on the web page $form_struct = ' type=text|class=fmtext|label=Name|fieldname=fm_name|max=100|req=true type=text|class=fmtext|label=Email|fieldname=fm_email|max=100|req=true|ver=email type=text|class=fmtext|label=Subject|fieldname=fm_subject|max=100|req=true type=verify|class=fmverify|label=Verify type=textarea|class=fmtextarea|label=Message|fieldname=fm_message|max=1000|rows=6|req=true '; // WRAP MESSAGES // If enabled, this wraps messages to 70 chars per line (for RFC compliance) $wrap_messages = TRUE; // SHOW REQUIRED // If enabled, required fields are marked with an asterisk $show_required = TRUE; // SHOW IP AND HOSTNAME // If enabled, the visitor's IP and hostname are added to the message $show_ip_hostname = TRUE; // SPECIAL FIELDS // These options help generate the email headers. Simply enter a field name, // and the user input from that field will be used. You can also combine fields. // For example, if you have a fm_firstname and fm_lastname field, you could // set $sender_name to 'fm_lastname, fm_firstname' $sender_name = 'fm_name'; $sender_email = 'fm_email'; $email_subject = 'Contact: fm_subject'; // MAX UPLOAD SIZE // If you are using file uploads in your form, this specifies the max file size. // (This does not override any server settings you might have in PHP.ini) $max_file_size = 1000000; // in bytes // MESSAGE STRUCTURE // This is an optional setting that allows you to define your own custom message // template. More information can be found on the web page. If left blank, the script // will generate the message itself, which is generally suitable for most purposes. // You use field names in this - they will be replaced with the user input from those fields. $message_structure = ''; // SUCCESS MESSAGE // This is the text shown after the visitor has successfully submitted the form. // You use field names in this - they will be replaced with the user input from those fields. $sent_message = '<p class="ctr">Thank you - your message has been sent. <br>Please choose another item from the menu.</p>'; // AUTO REPLY OPTION // This optional feature allows you to automatically send a pre-defined auto reply email. // To use it, simply specify the name and email address you want the message to be 'from', // as well as a subject and message. To disable, just leave $auto_reply_message blank. // You use field names in the message - they will be replaced with the user input from those fields. /* $auto_reply_name = ''; $auto_reply_email = ''; $auto_reply_subject = ''; $auto_reply_message = ''; */ // IMAGE VERIFICATION // The image verification system requires the GD library (included on most servers). If you // do not have GD, but still want to use the form, you can disable the verification feature. $verify_enable = TRUE; // VERIFICATION IMAGE COLORS // This allows you to specify the background and text color of the verification image. // You can use either 6 or 3 character hex color codes. $verify_background = 'FBF9EB'; $verify_text = '8E240E'; // FORCE IMAGE TYPE // If the verification image is not displaying, you can try forcing it to use another file type // Try setting it to 'gif', 'jpeg', or 'png' $force_type = ''; /* ** END OF OPTIONS */ if (!defined('PHP_EOL')) define ('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\r\n" : "\n"); if (trim($path_contact_page) == '') { $path_contact_page = $script_path; } /* Convert hex color code to R, G, B */ function ddfm_hex_to_rgb($h) { $h = trim($h, "#"); $color = array(); if (strlen($h) == 6) { $color[] = (int)hexdec(substr($h, 0, 2)); $color[] = (int)hexdec(substr($h, 2, 2)); $color[] = (int)hexdec(substr($h, 4, 2)); } else if (strlen($h) == 3) { $color[] = (int)hexdec(substr($h, 0, 1) . substr($h, 0, 1)); $color[] = (int)hexdec(substr($h, 1, 1) . substr($h, 1, 1)); $color[] = (int)hexdec(substr($h, 2, 1) . substr($h, 2, 1)); } return $color; } /* Handle requests for verification code */ if (isset($_GET['v'])) { if ($_GET['v'] == '1') { $this_domain = preg_replace("/^www\./", "", $_SERVER['HTTP_HOST']); // Choose image type $type = ''; if (function_exists("imagegif")) { $type = 'gif'; } else if (function_exists("imagejpeg")) { $type = 'jpeg'; } else if (function_exists("imagepng")) { $type = 'png'; } if (trim($force_type) != '') { $type = $force_type; } // Generate verification code srand((double)microtime()*1000000); $ddfmcode = substr(strtoupper(md5(rand(0, 999999999))), 2, 5); $ddfmcode = str_replace("O", "A", $ddfmcode); // for clarity $ddfmcode = str_replace("0", "B", $ddfmcode); setcookie("ddfmcode", md5($ddfmcode), time()+3600, '/', '.' . $this_domain); // Generate image header("Content-type: image/" . $type); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); header("Expires: Mon, 1 Jan 2000 01:00:00 GMT"); // Date in the past $image = imagecreate(60, 24); list($br, $bg, $bb) = ddfm_hex_to_rgb($verify_background); list($rr, $rg, $rb) = ddfm_hex_to_rgb($verify_text); $background_color = imagecolorallocate($image, $br, $bg, $bb); $text_color = imagecolorallocate($image, $rr, $rg, $rb); imagestring($image, 5, 8, 4, $ddfmcode, $text_color); switch ($type) { case 'gif': imagegif($image); break; case 'png': imagepng($image); break; case 'jpeg': imagejpeg($image, NULL, 100); break; } imagedestroy($image); exit(); } } // Load language settings require_once($language); /* Check for GD support */ function check_gd_support() { if (extension_loaded("gd") && (function_exists("imagegif") || function_exists("imagepng") || function_exists("imagejpeg"))) { return TRUE; } else { return FALSE; } } /* Safe str_replace */ function ddfm_str_replace($search, $replace, $subject) { if (isset($search)) { return str_replace($search, $replace, $subject); } else { return $subject; } } /* Check for valid URL */ function is_valid_url($link) { if (strpos($link, "http://") === FALSE) { $link = "http://" . $link; } $url_parts = @parse_url($link); if (empty($url_parts["host"])) return( false ); if (!empty($url_parts["path"])) { $documentpath = $url_parts["path"]; } else { $documentpath = "/"; } if (!empty($url_parts["query"])) { $documentpath .= "?" . $url_parts["query"]; } $host = $url_parts["host"]; $port = $url_parts["port"]; if (empty($port)) $port = "80"; $socket = @fsockopen( $host, $port, $errno, $errstr, 30 ); if (!$socket) { return(false); } else { fwrite ($socket, "HEAD ".$documentpath." HTTP/1.0\r\nHost: $host\r\nUser-Agent: DDFMVerify\r\n\r\n"); $http_response = fgets( $socket, 22 ); if (ereg("200 OK", $http_response, $regs)) { return(true); fclose($socket); } else { return(false); } } } /* Check for valid email address */ function dd_is_valid_email($email) { /* Credits: <a href="http://www.ilovejackdaniels.com/php/email-address-validation/" rel="nofollow">http://www.ilovejackdaniels.com/php/email-address-validation/</a> */ if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) { return false; } $email_array = explode("@", $email); $local_array = explode(".", $email_array[0]); for ($i = 0; $i < sizeof($local_array); $i++) { if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})<img src="https://csscreator.com/sites/all/modules/smileys/packs/Roving/angry.png" title="Angry" alt="Angry" class="smiley-content" />\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) { return false; } } if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { $domain_array = explode(".", $email_array[1]); if (sizeof($domain_array) < 2) { return false; // Not enough parts to domain } for ($i = 0; $i < sizeof($domain_array); $i++) { if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) { return false; } } } return true; } /* Check for injection characters */ function injection_chars($s) { return (eregi("\r", $s) || eregi("\n", $s) || eregi("%0a", $s) || eregi("%0d", $s)) ? TRUE : FALSE; } /* Make output safe for the browser */ function ddfm_bsafe($input) { return htmlspecialchars(stripslashes($input)); } function ddstripslashes($s) { if (get_magic_quotes_gpc()) { return stripslashes($s); } else { return $s; } } function injection_test($str) { $tests = array("/bcc\:/i", "/Content\-Type\:/i", "/Mime\-Version\:/i", "/cc\:/i", "/from\:/i", "/to\:/i", "/Content\-Transfer\-Encoding\:/i"); return preg_replace($tests, "", $str); } function send_mail($recipients, $sender_name, $sender_email, $email_subject, $email_msg, $attachments = false) { $extra_recips = ''; // generate recipient data from list if (strpos($recipients, '|')) { $rdata = array(); $ri = 0; $rtmp = explode('|', $recipients); foreach ($rtmp as $rd) { if (trim($rd) != "") { list($m, $e) = (array)explode("=", trim($rd), 2); $rdata[$ri]['m'] = trim(strtolower($m)); $rdata[$ri]['e'] = trim($e); $ri++; } } rsort($rdata); $r_to = array(); $extra_recips = ""; foreach ($rdata as $r) { if ($r['m'] == 'to') $r_to[] = $r['e']; if ($r['m'] == 'cc') $extra_recips .= 'Cc: ' . $r['e'] . PHP_EOL; if ($r['m'] == 'bcc') $extra_recips .= 'Bcc: ' . $r['e'] . PHP_EOL; } $send_to = implode(', ', $r_to); } else { $send_to = trim($recipients); } $sender_name = injection_test($sender_name); $sender_email = injection_test($sender_email); $email_subject = injection_test($email_subject); if (trim($sender_name) == "") { $sender_name = 'Anonymous'; } if (trim($sender_email) == "") { $sender_email = 'user@domain.com'; } if (trim($email_subject) == "") { $email_subject = 'Contact Form'; } $mime_boundary = md5(time()); $headers = ''; $msg = ''; $headers .= 'From: ' . $sender_name . ' <' . $sender_email . '>' . PHP_EOL; $headers .= $extra_recips; $headers .= 'Reply-To: ' . $sender_name . ' <' . $sender_email . '>' . PHP_EOL; $headers .= 'Return-Path: ' . $sender_name . ' <' . $sender_email . '>' . PHP_EOL; $headers .= "Message-ID: <" . time() . "[email protected]" . $_SERVER['SERVER_NAME'] . ">" . PHP_EOL; $headers .= 'X-Sender-IP: ' . $_SERVER["REMOTE_ADDR"] . PHP_EOL; $headers .= "X-Mailer: PHP v" . phpversion() . PHP_EOL; $headers .= 'MIME-Version: 1.0' . PHP_EOL; $headers .= 'Content-Type: multipart/related; boundary="' . $mime_boundary . '"'; $msg .= '--' . $mime_boundary . PHP_EOL; $msg .= 'Content-Type: text/plain; charset="iso-8859-1"' . PHP_EOL; $msg .= 'Content-Transfer-Encoding: 8bit' . PHP_EOL . PHP_EOL; $msg .= $email_msg . PHP_EOL . PHP_EOL; if (count($attachments) > <img src="https://csscreator.com/sites/all/modules/smileys/packs/Roving/innocent.png" title="Innocent" alt="Innocent" class="smiley-content" /> { for ($i = 0; $i < count($attachments); $i++) { if (is_file($attachments[$i]['tmpfile'])) { $handle = fopen($attachments[$i]['tmpfile'], 'rb'); $f_contents = fread($handle, filesize($attachments[$i]['tmpfile'])); $f_contents = chunk_split(base64_encode($f_contents)); fclose($handle); $msg .= '--' . $mime_boundary . PHP_EOL; $msg .= 'Content-Type: application/octet-stream; name="' . $attachments[$i]['file'] . '"' . PHP_EOL; $msg .= 'Content-Transfer-Encoding: base64' . PHP_EOL; $msg .= 'Content-Disposition: attachment; filename="' . $attachments[$i]['file'] . '"' . PHP_EOL . PHP_EOL; $msg .= $f_contents . PHP_EOL . PHP_EOL; } } } $msg .= '--' . $mime_boundary . '--' . PHP_EOL . PHP_EOL; ini_set('sendmail_from', $sender_email); $send_status = mail($send_to, $email_subject, $msg, $headers); ini_restore('sendmail_from'); return $send_status; } $form_input = array(); // START of functions to show form output function ddfm_gen_text($item) { // type=text|class=|label=|fieldname=|max=|req=(TRUEFALSE)|[ver=]|[default=] global $form_submitted, $form_input, $show_required; $req_text = (($show_required) && ($item['req'] == 'true')) ? '<span class="required">' . DDFM_REQUIREDTAG . '</span> ' : ''; $gen = ""; $gen .= '<p class="fieldwrap"><label for="' . $item['fieldname'] . '">' . $req_text . $item['label'] . '</label>'; $gen .= '<input class="' . $item['class'] . '" type="text" name="' . $item['fieldname'] . '" id="' . $item['fieldname'] . '" value="'; if ($form_submitted) { $gen .= ddfm_bsafe($form_input[$item['fieldname']]); } else if (isset($item['default'])) { $gen .= ddfm_bsafe($item['default']); } $gen .= '" /></p>' . "\n\n"; return $gen; } function ddfm_gen_password($item) { // type=password|class=|label=|fieldname=|max=|req=(TRUEFALSE)|confirm=(TRUEFALSE) global $form_submitted, $form_input, $show_required; $req_text = (($show_required) && $item['req'] == 'true') ? '<span class="required">' . DDFM_REQUIREDTAG . '</span> ' : ''; $gen = ""; $gen .= '<p class="fieldwrap"><label for="' . $item['fieldname'] . '">' . $req_text . $item['label'] . '</label>' . "\n"; $gen .= '<input class="' . $item['class'] . '" type="password" name="' . $item['fieldname'] . '" id="' . $item['fieldname'] . '" value="'; $gen .= '" /></p>' . "\n\n"; if ($item['confirm'] == 'true') { // Duplicate field (add 'c' to end) $gen .= '<p class="fieldwrap"><label for="' . $item['fieldname'] . 'c">' . $req_text . DDFM_CONFIRMPASS . ' ' . $item['label'] . '</label>' . "\n"; $gen .= '<input class="' . $item['class'] . '" type="password" name="' . $item['fieldname'] . 'c" id="' . $item['fieldname'] . 'c" value="'; $gen .= '" /></p>' . "\n\n"; } return $gen; } function ddfm_gen_textarea($item) { // type=textarea|class=|label=|fieldname=|max=|rows=|req=(TRUEFALSE)|[default=] global $form_submitted, $form_input, $show_required; $req_text = (($show_required) && $item['req'] == 'true') ? '<span class="required">' . DDFM_REQUIREDTAG . '</span> ' : ''; $gen = ""; $gen .= '<p class="fieldwrap"><label for="' . $item['fieldname'] . '">' . $req_text . $item['label'] . '</label>' . "\n"; $gen .= '<textarea class="' . $item['class'] . '" name="' . $item['fieldname'] . '" cols="20" rows="' . $item['rows'] . '" id="' . $item['fieldname'] . '">'; if ($form_submitted) { $gen .= ddfm_bsafe($form_input[$item['fieldname']]); } else if (isset($item['default'])) { $gen .= ddfm_bsafe($item['default']); } $gen .= '</textarea></p>' . "\n\n"; return $gen; } function ddfm_gen_widetextarea($item) { // type=widetextarea|class=|label=|fieldname=|max=|rows=|req=(TRUEFALSE)|[default=] global $form_submitted, $form_input, $show_required; $req_text = (($show_required) && $item['req'] == 'true') ? '<span class="required">' . DDFM_REQUIREDTAG . '</span> ' : ''; $gen = ""; $gen .= '<p class="fieldwrap"><label for="' . $item['fieldname'] . '" class="fmtextlblwide">' . $req_text . $item['label'] . '</label>' . "\n"; $gen .= '<textarea class="' . $item['class'] . '" name="' . $item['fieldname'] . '" cols="20" rows="' . $item['rows'] . '" id="' . $item['fieldname'] . '">'; if ($form_submitted) { $gen .= ddfm_bsafe($form_input[$item['fieldname']]); } else if (isset($item['default'])) { $gen .= ddfm_bsafe($item['default']); } $gen .= '</textarea></p>' . "\n\n"; return $gen; } function ddfm_gen_verify($item) { // type=verify|class=|label= global $verify_enable, $show_required, $script_path; if ($verify_enable == FALSE) return ''; $req_text = ($show_required) ? '<span class="required">' . DDFM_REQUIREDTAG . '</span> ' : ''; $gen = ""; if (check_gd_support()) { $gen .= '<p class="fieldwrap"><label for="fm_verify">' . $req_text . $item['label'] . '</label>' . "\n"; $gen .= '<input class="'. $item['class'] . '" type="text" name="fm_verify" id="fm_verify" />' . "\n"; $gen .= '<img src="' . $script_path . '?v=1" alt="' . $item['label'] . '" title="' . $item['label'] . '" />'; $gen .= '</p>' . "\n\n"; } return $gen; } function ddfm_gen_fullblock($item) { // type=fullblock|class=|text= $gen = ""; $gen .= '<p class="fieldwrap"><div class="' . $item['class'] . '">' . "\n"; $gen .= $item['text'] . "\n"; $gen .= '</div></p>' . "\n\n"; return $gen; } function ddfm_gen_halfblock($item) { // type=halfblock|class=|text= $gen = ""; $gen .= '<p class="fieldwrap"><div class="' . $item['class'] . '">' . "\n"; $gen .= $item['text'] . "\n"; $gen .= '</div></p>' . "\n\n"; return $gen; } function ddfm_gen_openfieldset($item) { // type=openfieldset|legend= $gen = ""; $gen .= '<fieldset><legend>' . ddfm_bsafe($item['legend']) . '</legend>' . "\n\n"; return $gen; } function ddfm_gen_closefieldset($item) { // type=closefieldset $gen = ""; $gen .= '</fieldset>' . "\n\n"; return $gen; } function ddfm_gen_checkbox($item) { // type=checkbox|class=|label=|data= // (fieldname),(text),(CHECKED),(REQUIRED), // (fieldname),(text),(CHECKED),(REQUIRED), // (fieldname),(text),(CHECKED),(REQUIRED) global $form_submitted, $form_input, $show_required; $gen = ""; $gen .= '<p class="fieldwrap"><label>' . $item['label'] . '</label><div class="' . $item['class'] . '">' . "\n"; $data = explode(",", trim($item['data'])); for ($i = 0; $i < sizeof($data); $i+=4) { $req_text = (($show_required) && ($data[$i+3] == 'true')) ? ' <span class="required">' . DDFM_REQUIREDTAG . '</span>' : ''; $gen .= '<p><input type="checkbox" name="' . $data[$i] . '" value="' . $data[$i + 1] . '"'; if ($form_submitted) { if (trim($form_input[$data[$i]]) != '') { $gen .= ' checked="checked"'; } } else { if ($data[$i + 2] == 'true') { $gen .= ' checked="checked"'; } } $gen .= ' />' . $data[$i + 1] . $req_text . '</p>' . "\n"; } $gen .= '</div></p>' . "\n\n"; return $gen; } function ddfm_gen_radio($item) { // type=radio|class=|label=|fieldname=|req=|[default=]|data= // (text),(text),(text) global $form_submitted, $form_input, $show_required; $req_text = (($show_required) && ($item['req'] == 'true')) ? '<span class="required">' . DDFM_REQUIREDTAG . '</span> ' : ''; $gen = ""; $gen .= '<p class="fieldwrap"><label>' . $req_text . $item['label'] . '</label><div class="' . $item['class'] . '">' . "\n"; $c = 1; $data = explode(",", trim($item['data'])); for ($i = 0; $i < sizeof($data); $i++) { $gen .= '<p><input type="radio" name="' . $item['fieldname'] . '" value="' . $data[$i] . '"'; if ($form_submitted) { if (trim($form_input[$item['fieldname']]) == $data[$i]) { $gen .= ' checked="checked"'; } } else { if ($c == $item['default']) { $gen .= ' checked="checked"'; } } $gen .= ' />' . $data[$i] . '</p>' . "\n"; $c++; } $gen .= '</div></p>' . "\n\n"; return $gen; } function ddfm_gen_select($item) { // type=select|class=|label=|fieldname=|multi=(TRUEFALSE)|data= // (#group),(text),(text),(#group),(text),(text) global $form_submitted, $form_input, $show_required; $req_text = (($show_required) && ($item['req'] == 'true')) ? '<span class="required">' . DDFM_REQUIREDTAG . '</span> ' : ''; $gen = ""; $gen .= '<p class="fieldwrap"><label>' . $req_text . $item['label'] . '</label><select class="' . $item['class'] . '" name="' . $item['fieldname']; if ($item['multi'] == 'true') { $gen .= '[]'; } $gen .= '"'; if ($item['multi'] == 'true') { $gen .= ' multiple="multiple"'; } $gen .= '>' . "\n"; $c = 1; $og = FALSE; $data = explode(",", trim($item['data'])); for ($i = 0; $i < sizeof($data); $i++) { if (substr($data[$i], 0, 1) == '#' ) { if ($og) { $gen .= '</optgroup>' . "\n"; } $gen .= '<optgroup label="' . ltrim($data[$i], '#') . '">' . "\n"; $og = TRUE; } else { $gen .= '<option'; if ($form_submitted) { if ($item['multi'] == 'true') { foreach ((array)$form_input[$item['fieldname']] as $ii) { if ($data[$i] == $ii) { $gen .= ' selected="selected"'; } } } else { if (trim($form_input[$item['fieldname']]) == $data[$i]) { $gen .= ' selected="selected"'; } } } $gen .= ' >' . $data[$i] . '</option>' . "\n"; } $c++; } if ($og) { $gen .= '</optgroup>' . "\n"; $og = FALSE; } $gen .= '</select></p>' . "\n\n"; return $gen; } function ddfm_gen_file($item) { // type=file|class=|label=|fieldname=|req=(TRUEFALSE)|[allowed=1,2,3] global $form_submitted, $form_input, $show_required, $max_file_size; $req_text = (($show_required) && ($item['req'] == 'true')) ? '<span class="required">' . DDFM_REQUIREDTAG . '</span> ' : ''; $gen = ""; $gen .= '<p class="fieldwrap"><label for="' . $item['fieldname'] . '">' . $req_text . $item['label'] . '</label>' . "\n"; $gen .= '<input class="' . $item['class'] . '" type="file" name="' . $item['fieldname'] . '" id="' . $item['fieldname'] . '" '; $gen .= ' /></p>' . "\n\n"; return $gen; } function ddfm_gen_selrecip($item) { // type=selrecip|class=|label=|data=User1,user1@domain.com,User2 etc.. global $form_submitted, $form_input, $show_required; $req_text = ($show_required) ? '<span class="required">' . DDFM_REQUIREDTAG . '</span> ' : ''; $gen = ""; $gen .= '<p class="fieldwrap"><label>' . $req_text . $item['label'] . '</label><select class="' . $item['class'] . '" name="fm_selrecip">' . "\n"; $data = explode(",", trim($item['data'])); $gen .= '<option'; if ($form_submitted) { if (trim($form_input['fm_selrecip']) == $data[0]) { $gen .= ' selected="selected"'; } } $gen .= ' >' . $data[0] . '</option>' . "\n"; for ($i = 1; $i < sizeof($data); $i+=2) { $gen .= '<option'; if ($form_submitted) { if (trim($form_input['fm_selrecip']) == $data[$i]) { $gen .= ' selected="selected"'; } } $gen .= ' >' . $data[$i] . '</option>' . "\n"; } $gen .= '</select></p>' . "\n\n"; return $gen; } // END of functions to show form output /* Generate the script output */ // convert $form_struct into array of strings $form_struct = (array)explode('<br />', nl2br(trim($form_struct))); // Prepare globals $form_submitted = FALSE; $message_sent = FALSE; // Prepare output $o = "\n\n\n" . '<!-- START of Dagon Design Formmailer output -->' . "\n\n"; // Convert form structure to multi-dimensional array $fs_tmp1 = array(); $fs_tmp2 = array(); $fitem = 0; foreach ($form_struct as $fs) { if (trim($fs) != "") { $fs_tmp1 = (array)explode("|", trim($fs)); foreach ($fs_tmp1 as $fs1) { list($k, $v) = (array)explode("=", trim($fs1), 2); $fs_tmp2[$fitem][$k] = $v; } } $fitem++; } $form_struct = $fs_tmp2; // Make sure form structure is not missing empty keys $valid_keys = array('fieldname', 'type', 'req', 'label', 'max', 'ver', 'confirm', 'data', 'multi', 'allowed', 'default'); for ($i = 0; $i < count($form_struct); $i++) { foreach ($valid_keys as $k) { if (!isset($form_struct[$i][$k])) $form_struct[$i][$k] = NULL; } } // Was form submitted? if (isset($_POST["form_submitted"])) { $form_submitted = TRUE; $mail_message = ""; $attached_files = array(); $attached_index = 0; $sel_recip = NULL; $message_structure = trim($message_structure); unset($errors); $errors = array(); // Get form input and put in array foreach ($_POST as $key => $i) { if ($key != "form_submitted") { if (!is_array($i)) { $form_input[strtolower($key)] = trim($i); } else { $form_input[strtolower($key)] = $i; } } } $msg_field_sep = ': '; $msg_field_line_end = "\n\n"; $fsindex = -1; // Validate input foreach ($form_struct as $fs) { if (!isset($form_input[$fs['fieldname']])) { $form_input[$fs['fieldname']] = ''; } $fsindex++; // check for fields used in vars if (isset($form_input[$fs['fieldname']])) { $sender_name = ddfm_str_replace($fs['fieldname'], ddstripslashes($form_input[$fs['fieldname']]), $sender_name); $sender_email = ddfm_str_replace($fs['fieldname'], ddstripslashes($form_input[$fs['fieldname']]), $sender_email); $email_subject = ddfm_str_replace($fs['fieldname'], ddstripslashes($form_input[$fs['fieldname']]), $email_subject); } switch ($fs['type']) { case 'text': // type=text|class=|label=|fieldname=|max=|req=(TRUEFALSE)|[ver=]|[default=] $t = ddstripslashes($form_input[$fs['fieldname']]); if ((strtolower($fs['req']) == 'true') && ($t == "")) { $errors[] = DDFM_MISSINGFIELD . " '" . $fs['label'] . "'"; } else if (strlen($t) > (int)$fs['max']) { $errors[] = $fs['max'] . ' ' . DDFM_MAXCHARLIMIT . " '" . $fs['label'] . "'"; } else if (injection_chars($t)) { $errors[] = DDFM_INVALIDINPUT . " '" . $fs['label'] . "'"; } else if ((strtolower($fs['ver']) == 'email') && ((strtolower($fs['req']) == "true") || ($t != ""))) { if (!dd_is_valid_email($t)) $errors[] = DDFM_INVALIDEMAIL . " '" . $fs['label'] . "'"; } else if ((strtolower($fs['ver']) == 'url') && ((strtolower($fs['req']) == "true") || ($t != ""))) { if (!is_valid_url($t)) $errors[] = DDFM_INVALIDURL . " '" . $fs['label'] . "'"; } $mail_message .= $fs['label'] . $msg_field_sep . $t . $msg_field_line_end; $message_structure = ddfm_str_replace($fs['fieldname'], $t, $message_structure); $auto_reply_message = ddfm_str_replace($fs['fieldname'], $t, $auto_reply_message); $sent_message = ddfm_str_replace($fs['fieldname'], ddfm_bsafe($t), $sent_message); break; case 'password': // type=password|class=|label=|fieldname=|max=|req=(TRUEFALSE)|confirm=(TRUEFALSE) $t = ddstripslashes($form_input[$fs['fieldname']]); if ((strtolower($fs['req']) == 'true') && ($t == "")) { $errors[] = DDFM_MISSINGFIELD . " '" . $fs['label'] . "'"; } else if (strlen($t) > (int)$fs['max']) { $errors[] = $fs['max'] . ' ' . DDFM_MAXCHARLIMIT . " '" . $fs['label'] . "'"; } else if (injection_chars($t)) { $errors[] = DDFM_INVALIDINPUT . " '" . $fs['label'] . "'"; } else if (strtolower($fs['confirm']) == 'true') { $tc = ddstripslashes($form_input[$fs['fieldname'] . 'c']); if ($t != $tc) $errors[] = DDFM_NOMATCH . " '" . $fs['label'] . "'"; } $mail_message .= $fs['label'] . $msg_field_sep . $t . $msg_field_line_end; $message_structure = ddfm_str_replace($fs['fieldname'], $t, $message_structure); $auto_reply_message = ddfm_str_replace($fs['fieldname'], $t, $auto_reply_message); $sent_message = ddfm_str_replace($fs['fieldname'], ddfm_bsafe($t), $sent_message); break; case 'textarea': case 'widetextarea': // type=textarea|class=|label=|fieldname=|max=|rows=|req=(TRUEFALSE)|[default=] $t = ddstripslashes($form_input[$fs['fieldname']]); if ((strtolower($fs['req']) == 'true') && ($t == "")) { $errors[] = DDFM_MISSINGFIELD . " '" . $fs['label'] . "'"; } else if (strlen($t) > (int)$fs['max']) { $errors[] = $fs['max'] . ' ' . DDFM_MAXCHARLIMIT . " '" . $fs['label'] . "'"; } $mail_message .= $fs['label'] . $msg_field_sep . $t . $msg_field_line_end; $message_structure = ddfm_str_replace($fs['fieldname'], $t, $message_structure); $auto_reply_message = ddfm_str_replace($fs['fieldname'], $t, $auto_reply_message); $sent_message = ddfm_str_replace($fs['fieldname'], ddfm_bsafe($t), $sent_message); break; case 'verify': // type=verify|class=|label= if ($verify_enable == TRUE) { $t = ddstripslashes($form_input['fm_verify']); if ($t == "") { $errors[] = DDFM_MISSINGVER; } else if (trim($_COOKIE["ddfmcode"]) == "") { $errors[] = DDFM_NOVERGEN; } else if ($_COOKIE["ddfmcode"] != md5(strtoupper($t))) { $errors[] = DDFM_INVALIDVER; } } break; case 'checkbox': // type=checkbox|class=|label=|data= // (fieldname),(text),(CHECKED),(REQUIRED), // (fieldname),(text),(CHECKED),(REQUIRED), // (fieldname),(text),(CHECKED),(REQUIRED) $data = explode(",", trim($fs['data'])); $tmp_msg = array(); for ($i = 0; $i < count($data); $i+=4) { $t = ddstripslashes(trim($form_input[$data[$i]])); if ((strtolower($data[$i+3]) == 'true') && ($t == "")) { $errors[] = DDFM_MISSINGFIELD . " '" . $fs['label'] . "'"; } if ($t != "") $tmp_msg[] = $t; $message_structure = ddfm_str_replace($data[$i], $t, $message_structure); $auto_reply_message = ddfm_str_replace($data[$i], $t, $auto_reply_message); $sent_message = ddfm_str_replace($data[$i], ddfm_bsafe($t), $sent_message); } $mail_message .= $fs['label'] . $msg_field_sep . implode(', ', $tmp_msg) . $msg_field_line_end; break; case 'radio': // type=radio|class=|label=|fieldname=|req=|[default=]|data= // (text),(text),(text),(text) $t = ddstripslashes(trim($form_input[$fs['fieldname']])); if ((strtolower($fs['req']) == 'true') && ($t == "")) { $errors[] = DDFM_MISSINGFIELD . " '" . $fs['label'] . "'"; } $mail_message .= $fs['label'] . $msg_field_sep . $t . $msg_field_line_end; $message_structure = ddfm_str_replace($fs['fieldname'], $t, $message_structure); $auto_reply_message = ddfm_str_replace($fs['fieldname'], $t, $auto_reply_message); $sent_message = ddfm_str_replace($fs['fieldname'], ddfm_bsafe($t), $sent_message); break; case 'select': // type=select|class=|label=|fieldname=|multi=(TRUEFALSE)|data= // (#group),(text),(text),(#group),(text),(text) $data = explode(",", trim($fs['data'])); if (strtolower($fs['multi']) != 'true') { $t = ddstripslashes($form_input[$fs['fieldname']]); if ((strtolower($fs['req']) == 'true') && (($t == "") || ($t == $first_item))) { $errors[] = DDFM_MISSINGFIELD . " '" . $fs['label'] . "'"; } $mail_message .= $fs['label'] . $msg_field_sep . $t . $msg_field_line_end; $message_structure = ddfm_str_replace($fs['fieldname'], $t, $message_structure); $auto_reply_message = ddfm_str_replace($fs['fieldname'], $t, $auto_reply_message); $sent_message = ddfm_str_replace($fs['fieldname'], ddfm_bsafe($t), $sent_message); } else { // multi = true $t = (array)$form_input[$fs['fieldname']]; if ((count($t) == 1) && ($t[0] == '')) { unset($t[0]); } if ((strtolower($fs['req']) == 'true') && (count($t) == <img src="https://csscreator.com/sites/all/modules/smileys/packs/Roving/innocent.png" title="Innocent" alt="Innocent" class="smiley-content" />) { $errors[] = DDFM_MISSINGFIELD . " '" . $fs['label'] . "'"; } $tmp_msg = array(); foreach ($t as $tt) { if ($tt != "") $tmp_msg[] = $tt; } $mail_message .= $fs['label'] . $msg_field_sep . implode(', ', $tmp_msg) . $msg_field_line_end; $message_structure = ddfm_str_replace($fs['fieldname'], implode(', ', $tmp_msg), $message_structure); $auto_reply_message = ddfm_str_replace($fs['fieldname'], implode(', ', $tmp_msg), $auto_reply_message); $sent_message = ddfm_str_replace($fs['fieldname'], ddfm_bsafe(implode(', ', $tmp_msg)), $sent_message); } break; case 'file': // type=file|class=|label=|fieldname=|[req=]|[allowed=1,2,3] if ((strtolower($fs['req']) == 'true') && (($_FILES[$fs['fieldname']]['name'] == ""))) { $errors[] = DDFM_MISSINGFILE . " '" . $fs['label'] . "'"; } $allowed = array(); if (trim($fs['allowed']) != "") { $allowed = (array)explode(",", trim(strtolower($fs['allowed']))); } if (($_FILES[$fs['fieldname']]['name'] != "") && ((int)$_FILES[$fs['fieldname']]['size'] == <img src="https://csscreator.com/sites/all/modules/smileys/packs/Roving/innocent.png" title="Innocent" alt="Innocent" class="smiley-content" />) { $errors[] = DDFM_FILETOOBIG . ' ' . $_FILES[$fs['fieldname']]['name']; } else if ($_FILES[$fs['fieldname']]['tmp_name'] != "") { if (($_FILES[$fs['fieldname']]['error'] == UPLOAD_ERR_OK) && ($_FILES[$fs['fieldname']]['size'] > <img src="https://csscreator.com/sites/all/modules/smileys/packs/Roving/innocent.png" title="Innocent" alt="Innocent" class="smiley-content" />) { $origfilename = $_FILES[$fs['fieldname']]['name']; $filename = explode(".", $_FILES[$fs['fieldname']]['name']); $filenameext = $filename[count($filename) - 1]; unset($filename[count($filename) - 1]); $filename = implode(".", $filename); $filename = substr($filename, 0, 15) . "." . $filenameext; $file_ext_allow = TRUE; if (count($allowed) > <img src="https://csscreator.com/sites/all/modules/smileys/packs/Roving/innocent.png" title="Innocent" alt="Innocent" class="smiley-content" /> { $file_ext_allow = FALSE; for ($x = 0; $x < count($allowed); $x++) { if (strtolower($filenameext) == strtolower($allowed[$x])) { $file_ext_allow = TRUE; } } } if ($file_ext_allow) { if((int)$_FILES[$fs['fieldname']]['size'] < $max_file_size) { $attached_files[$attached_index]['file'] = $_FILES[$fs['fieldname']]['name']; $attached_files[$attached_index]['tmpfile'] = $_FILES[$fs['fieldname']]['tmp_name']; $attached_files[$attached_index]['content_type'] = $_FILES[$fs['fieldname']]['type']; $attached_index++; $mail_message .= DDFM_ATTACHED . $msg_field_sep . $_FILES[$fs['fieldname']]['name'] . "\n\n"; $message_structure = ddfm_str_replace($fs['fieldname'], $_FILES[$fs['fieldname']]['name'], $message_structure); $auto_reply_message = ddfm_str_replace($fs['fieldname'], $_FILES[$fs['fieldname']]['name'], $auto_reply_message); $sent_message = ddfm_str_replace($fs['fieldname'], $_FILES[$fs['fieldname']]['name'], $sent_message); } else { $errors[] = DDFM_FILETOOBIG . ' ' . $_FILES[$fs['fieldname']]['name']; } } else { $errors[] = DDFM_INVALIDEXT . ' ' . $_FILES[$fs['fieldname']]['name']; } } else { $errors[] = DDFM_UPLOADERR . ' ' . $_FILES[$fs['fieldname']]['name']; } } $message_structure = ddfm_str_replace($fs['fieldname'], '', $message_structure); $auto_reply_message = ddfm_str_replace($fs['fieldname'], $t, $auto_reply_message); $sent_message = ddfm_str_replace($fs['fieldname'], ddfm_bsafe($t), $sent_message); break; case 'selrecip': // type=selrecip|class=|label=|data=(select),User1,user1@domain.com,User2 etc.. $data = explode(",", trim($fs['data'])); $t = ddstripslashes($form_input['fm_selrecip']); if (($t == "") || ($t == $data[0])) { $errors[] = DDFM_MISSINGFIELD . " '" . $fs['label'] . "'"; } else { for ($i = 1; $i < count($data); $i+=2) { if ($data[$i] == $t) { $sel_recip = $data[$i+1]; } } } break; } } // make sure no un-used fieldnames are left in template foreach ($form_struct as $fs) { $message_structure = ddfm_str_replace($fs['fieldname'], '', $message_structure); $auto_reply_message = ddfm_str_replace($fs['fieldname'], '', $auto_reply_message); $sent_message = ddfm_str_replace($fs['fieldname'], '', $sent_message); } if (injection_chars($sender_name)) $errors[] = DDFM_INVALIDINPUT; if (injection_chars($sender_email)) $errors[] = DDFM_INVALIDINPUT; if (injection_chars($email_subject)) $errors[] = DDFM_INVALIDINPUT; if ($errors) { $o .= '<div class="ddfmwrap"><div class="ddfmerrors">' . DDFM_ERRORMSG . '</div>'; $o .= '<div class="errorlist">'; foreach ($errors as $err) { $o .= $err . '<br />'; } $o .= '</div><div style="clear:both;"><!-- --></div></div>'; } else { if ($wrap_messages) { $mail_message = wordwrap($mail_message, 70); } if ($recipients == 'selrecip') { $recipients = $sel_recip; } // if template exists, use it instead if (strlen(trim($message_structure)) > <img src="https://csscreator.com/sites/all/modules/smileys/packs/Roving/innocent.png" title="Innocent" alt="Innocent" class="smiley-content" /> { $mail_message = $message_structure . "\n\n"; } if ($show_ip_hostname) { $mail_message .= 'IP: ' . $_SERVER['REMOTE_ADDR'] . "\n" . 'HOST: ' . gethostbyaddr($_SERVER['REMOTE_ADDR']) . "\n"; } if (send_mail($recipients, $sender_name, $sender_email, $email_subject, $mail_message, $attached_files)) { $o .= $sent_message; $auto_reply_name = trim($auto_reply_name); $auto_reply_email = trim($auto_reply_email); $auto_reply_subject = trim($auto_reply_subject); $auto_reply_message = trim($auto_reply_message); if (($auto_reply_message != "") && (trim($sender_email != ""))) { $auto_reply_header = ""; $auto_reply_header .= 'From: ' . $auto_reply_name . ' <' . $auto_reply_email . '>' . PHP_EOL; $auto_reply_header .= 'Reply-To: ' . $auto_reply_name . ' <' . $auto_reply_email . '>' . PHP_EOL; $auto_reply_header .= 'Return-Path: ' . $auto_reply_name . ' <' . $auto_reply_email . '>' . PHP_EOL; mail($sender_email, $auto_reply_subject, $auto_reply_message, $auto_reply_header); } $message_sent = TRUE; $_POST = array(); } else { $o .= DDFM_SERVERERR; $message_sent = FALSE; } } } // end of form submission processing // Generate form if message has not been sent if (!$message_sent) { if ($verify_enable == TRUE && !check_gd_support()) { $o .= DDFM_GDERROR; } $o .= '<div class="ddfmwrap">'; $o .= '<form class="ddfm" name="form1" method="post" action="' . $path_contact_page . '" enctype="multipart/form-data">' . "\n\n"; // Loop through form items foreach ($form_struct as $f_i) { switch ($f_i['type']) { case 'text': $o .= ddfm_gen_text($f_i, $show_required); break; case 'password': $o .= ddfm_gen_password($f_i, $show_required); break; case 'textarea': $o .= ddfm_gen_textarea($f_i, $show_required); break; case 'widetextarea': $o .= ddfm_gen_widetextarea($f_i, $show_required); break; case 'verify': $o .= ddfm_gen_verify($f_i, $show_required); break; case 'fullblock': $o .= ddfm_gen_fullblock($f_i, $show_required); break; case 'halfblock': $o .= ddfm_gen_halfblock($f_i, $show_required); break; case 'openfieldset': $o .= ddfm_gen_openfieldset($f_i, $show_required); break; case 'closefieldset': $o .= ddfm_gen_closefieldset($f_i, $show_required); break; case 'checkbox': $o .= ddfm_gen_checkbox($f_i, $show_required); break; case 'radio': $o .= ddfm_gen_radio($f_i, $show_required); break; case 'select': $o .= ddfm_gen_select($f_i, $show_required); break; case 'file': $o .= ddfm_gen_file($f_i, $show_required); break; case 'selrecip': $o .= ddfm_gen_selrecip($f_i, $show_required); break; } } $o .= '<p><input type="hidden" name="MAX_FILE_SIZE" value="' . $max_file_size . '" /></p>' . "\n"; $o .= '<div class="submit"><input type="submit" name="form_submitted" value="' . DDFM_SUBMITBUTTON . '" /></div>' . "\n\n"; $o .= '<div class="credits">' . DDFM_CREDITS . ' <a href="http://www.dagondesign.com" title="Dagon Design">Dagon Design</a></div>' . "\n\n"; $o .= '</form>'; $o .= '</div>' . "\n\n"; // Form generation complete } // end of display form code $o .= '<!-- END of Dagon Design Formmailer output -->' . "\n\n\n"; /* Page Generation */ if ($standalone) { // START OF PAGE HEADER ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <head profile="http://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Contact</title> <link rel="stylesheet" href="<?php echo $path_to_css; ?>" type="text/css" media="screen"> </head> <body> <div align="center"> <div style="width: 380px; margin: 0 auto 0 auto; text-align:left;"> <?php // END OF PAGE HEADER } // show script output echo $o; if ($standalone) { // START OF PAGE FOOTER ?> </div> </div> </body> </html> <?php // END OF PAGE FOOTER } ?>
The derived code in "view source" is as follows:
<!-- START of Dagon Design Formmailer output --> <div class="ddfmwrap"><form class="ddfm" name="form1" method="post" action="http://www.mindsavers.com.au/contactdeb.php" enctype="multipart/form-data"> <p class="fieldwrap"><label for="fm_name"><span class="required">*</span> Name</label><input class="fmtext" type="text" name="fm_name" id="fm_name" value="" /></p> <p class="fieldwrap"><label for="fm_email"><span class="required">*</span> Email</label><input class="fmtext" type="text" name="fm_email" id="fm_email" value="" /></p> <p class="fieldwrap"><label for="fm_subject"><span class="required">*</span> Subject</label><input class="fmtext" type="text" name="fm_subject" id="fm_subject" value="" /></p> <p class="fieldwrap"><label for="fm_verify"><span class="required">*</span> Verify</label> <input class="fmverify" type="text" name="fm_verify" id="fm_verify" /> <img src="http://www.mindsavers.com.au/phpincludes/dd-formmailer/dd-formmailer.php?v=1" alt="Verify" title="Verify" /></p> <p class="fieldwrap"><label for="fm_message"><span class="required">*</span> Message</label> <textarea class="fmtextarea" name="fm_message" cols="20" rows="6" id="fm_message"></textarea></p> <p><input type="hidden" name="MAX_FILE_SIZE" value="1000000" /></p> <div class="submit"><input type="submit" name="form_submitted" value="Send Email" /></div> <div class="credits">Script by <a href="http://www.dagondesign.com" title="Dagon Design">Dagon Design</a></div> </form></div> <!-- END of Dagon Design Formmailer output -->
Thanks as always
I think you need to edit
I think you need to edit these lines (and any other similar ones):
function ddfm_gen_file($item) { // type=file|class=|label=|fieldname=|req=(TRUEFALSE)|[allowed=1,2,3] global $form_submitted, $form_input, $show_required, $max_file_size; $req_text = (($show_required) && ($item['req'] == 'true')) ? '<span class="required">' . DDFM_REQUIREDTAG . '</span> ' : ''; $gen = ""; $gen .= '<p class="fieldwrap"><label for="' . $item['fieldname'] . '">' . $req_text . $item['label'] . '</label>' . "\n"; $gen .= '<input class="' . $item['class'] . '" type="file" name="' . $item['fieldname'] . '" id="' . $item['fieldname'] . '" '; <span style="font-weight:bold">$gen .= ' <span style="color:red">/</span>></p>' . "\n\n";</span> return $gen; }
this function generates a label and input wrapped in a paragraph, that last line before the results are retuned to the function simply outputs the closing input tag and paragraph tag (label having been closed earlier)
You should be able to do a find and replace on '/>' to '>' but obviously before editing the file make a copy so that if things go wrong you can simply put the copy back in the main body of files.
Thanks Hugo - I'll let you
Thanks Hugo - I'll let you know how I get on...and thanks also for reminding me to copy the file first!
Well I'm finally back to
Well I'm finally back to this but...what about when it has two /> do I change them both?
function ddfm_gen_password($item) { // type=password|class=|label=|fieldname=|max=|req=(TRUEFALSE)|confirm=(TRUEFALSE) global $form_submitted, $form_input, $show_required; $req_text = (($show_required) && $item['req'] == 'true') ? '<span class="required">' . DDFM_REQUIREDTAG . '</span> ' : ''; $gen = ""; $gen .= '<p class="fieldwrap"><label for="' . $item['fieldname'] . '">' . $req_text . $item['label'] . '</label>' . "\n"; $gen .= '<input class="' . $item['class'] . '" type="password" name="' . $item['fieldname'] . '" id="' . $item['fieldname'] . '" value="'; $gen .= '" <span style="color:red">/></span></p>' . "\n\n"; if ($item['confirm'] == 'true') { // Duplicate field (add 'c' to end) $gen .= '<p class="fieldwrap"><label for="' . $item['fieldname'] . 'c">' . $req_text . DDFM_CONFIRMPASS . ' ' . $item['label'] . '</label>' . "\n"; $gen .= '<input class="' . $item['class'] . '" type="password" name="' . $item['fieldname'] . 'c" id="' . $item['fieldname'] . 'c" value="'; $gen .= '" <span style="color:red">/></span></p>' . "\n\n"; } return $gen; }
yes change them both, the
yes change them both, the second is another input but only printed out if a condition is true.
Think about it this way in HTML there is no such thing as /> this is only where empty elements are concerned as XHTML requires that all tags are closed, HTML is happy for them to be implicitly closed.
As with all things though test it and see.
Thanks for the quick
Thanks for the quick response Hugo
I'm down to 2 warnings but I can't find those two...any chance you can point me at them?
Validate the contact form
and look at 'view source' and you will see the two I mean.
I only see one <p><input
I only see one
<p><input type="hidden" name="MAX_FILE_SIZE" value="1000000"></p> <div class="submit"><input type="submit" name="form_submitted" value="Send Email" /></div>
A matter of trawling back through that file and scanning carefully for that hidden input, it might be located at another point in the script as it's a hidden field
Aaah...thanks I found that
Aaah...thanks
I found that one. It was form_submitted that I had to change about 4 occurences - I thought there would be only one.
Have just sent a test and that worked tooo!
I passed - no errors
good oh!
good oh!
Not so good I'm afraid
Not so good I'm afraid
Despite previous reassurances, I had the opportunity to view the site in Vista-IE7 and XP-IE6 this week and to use Hugo's phrase...they are both borked.
My VBox XP-IE6 also shows the same problems.
I've fixed one of them namely the shaded box in the content section on the home page was running full width. So I adjusted the Conditional Comments and put a width/min-width in "deb-box" in the css.
However it's lost the margins on the content and at the bottom (after the ul) it loses its place altogether!! See attached
Help please!
Attachment | Size |
---|---|
Plato-msavers-XP-IE6.jpg | 134.65 KB |
Vicky have you fixed this?
Vicky have you fixed this? as looking at home page in IE7 on a vista box and it looks fine
No i haven't and it still
No i haven't and it still looks like the pic I attached. I don't know whether I screwed it up doing something or whether it's been like this for a while. The thing is it still validates!
I only see a problem in IE6
I only see a problem in IE6 not in IE7 as you stated. In IE6 I would guess the issue lies with #content by the looks of things once you are clear of the floated sidebar the right content is wrapping under it, you should really have margined the right side away from the left sidebar to avoid this, or you could try setting hasLayout for IE6 on #content and see if that changes things
Hi there...duh! under the
Hi there...duh! under the sidebar...of course. Well I'm off to an all-day seminar and don't have time to try this now but those two suggestions sound good to me.
One thing - what can I use for HasLayout on #Content - pos:rel won't do it will it? - I don't want to use Zoom 'cos it won't validate.
You can use
You can use display:inline-block; then repeat the selector and reset display to block, I only suggest hasLayout as I thought that I saw some oddities occuring but the margin left will sort the main issue out.
why not use "zoom:1".
why not use "zoom:1".
Hugo - ooeerk! now the
Hugo - ooeerk! now the entire #content in XP-IE6 drops below the sidebar!! This is what I've now got...
#content { margin-left: 2em; padding: 30px; overflow: hidden; display: inline-block; } #content {display: block;}
Tried taking the padding out. Tried float:left since both the #wrapinner and #sidebar are floated - no go
Chris - it won't validate will it? and it's important that this site does validate.
From #content, remove float:
From #content, remove float: and margin-left:. From the h2, remove the -.5em top margin.
To the sidebar, add 2em right margin.
cheers,
gary
Hi Gary...no, sorry still
Hi Gary...no, sorry still got float drop in XP-IE6
I had already taken out the float-left: :? I understand the reasoning behind the rest I think, except for taking out the
.first-h2 {margin: -0.5em 0 0 0;}
which is there because I don't want that big gap before the first heading on each page.
If Gary's suggestions don't
If Gary's suggestions don't work go back to margin-left on #content but see what setting pixel value does instead of em. why em anyway is this an attempt at a elastic layout?
validation of CSS styles is of no ones concern other than the developer, validating CSS is simply useful for picking up errors and even then it's not really useful for that tbh, CSS has a level of error checking if syntax/properties are incorrect it either drops the declaration or refuses to parse any further.
Don't put too much store by validating CSS we only bang on about validating Markup due to the ease at which rendering engines will attempt to make sense out of mush and never let you know that there is a problem somewhere.
All the same I do like clean styles and zoom is proprietary so I always - if I use it - keep it in IE conditionals, it still doesn't validate but the point of Conditionals is that they are for IE alone.
Hmmm...nope. Margins stuffed
Hmmm...nope. Margins stuffed in Mac-FF3 and float drop in XP-IE6. It's getting worserer
I know css validation is not normally of concern but I've explained before I think that this site is up against stiff competition and the visitors/clients will be mainly government - I want to be able to put the ticks on.
ETA:
why em anyway is this an attempt at a elastic layout?
Attempt? Cheeky.! It is and always was an elastic layout, (just have to get the min-width on the deb-box right once the content margins are settled) so yes margins are always specified in ems.
it cant be getting worse,
it cant be getting worse, this is a straightforward layout technique, sidebar has a fixed width content gets a margin-left a bit greater than sidebar width.
You have clearfix rules available try adding that class to major elements that have no apparent hasLayout trigger such as the wrapinner and wrapouter elements and also for testing disable the IE expressions
All I changed was to put the
All I changed was to put the right sized margin-left on #content (it's late and my brain is mush after the workshop today) and put back my padding: 30px.
Everything looks fine in both Mac and Win except when I reduce the IE window the content THEN drops below the sidebar. However it happens much earlier than when the min-width kicks in (scroll bars appear).
I'll look again tomorrow.
Thanks Hugo.
If the element drops much
If the element drops much earlier than you min-width kicks in that should tell you immediately the you have a width greater than the min width you think you are setting. it should allude to the fact that you have natural fixed widths in the layout somewhere or set fixed widths. Simple test is to see at what point those scroller bars really do kick in at, if you determine that you will find that it is far wider than the min-width values you are setting, now you know what to look for, somewhere in your layout are elements that have fixed widths and that add up to a value greater than your min width; so looking around one can see sidebar has fixed width 247px looking at #content and one immediately settles on the obvious visual box in the top middle section, checking that finds that it has a fixed width of 560px ; so 560 + 247 = 807 and what is the min width? 780px?
Also it should have been noticed that when narrowing the browser to point where scrollbars kick in doesn't allow you to actually scroll the right edge of your layout back on to screen you have lost 27px.
Either reduce width of that box to ~530px or increase the min-width value or combo of both.
Thanks Hugo - I was so tired
Thanks Hugo - I was so tired last night I couldn't think straight I'll play with the deb-box and get that working properly. I may even put it below the next para since it has always looked a little odd to me where it is.
Well I think I've tried just
Well I think I've tried just about every combination here. Firstly I tried adjusting the min-widths but the problem as I see it is that I have to have a width in the ruleset for #content because IE doesn't handle min-max.
Do I actually have to have width or will the CCs take care of it for IE? I seem to have this idea the ruleset has to have both width and min-width in it. The width overrides everything for IE and the box becomes a static xxxpx wide.
So now I've got width:auto; which actually works! Except that it depends on the width of the browser (XP-IE6)as to whether it works or you get float drop.
FF3 appears to work in both Mac and IE. I've pout the clearfix on both wrappers anyway. Just in case.
I've taken out the width.
I've taken out the width. Min-width:470px, max-width:528px, (sidebar=247px) and it still floats all over the place in XP-IE6
it's not the min/max widths
it's not the min/max widths that are the issue it was the fixed width
But it still drops depending
But it still drops depending how wide the browser is.
Take a look at how I do
Take a look at how I do exactly what you're trying to accomplish. See my common css for pages on my site, specifically this:
#wrapper { background-color: #fff; color: #333; margin: 0 auto; max-width: 1024px; min-width: 760px; overflow: hidden; position: relative; width: 90%; } * html #wrapper { width: 760px; /* Star hack to set fixed width for IE6 */ }
I haven't followed this thread all that closely, but it appears you're throwing high level sh, um, stuff at low level problems hoping something will stick, or maybe it's vice versa.
cheers,
gary
Hi Gary A question then a
Hi Gary A question then a recap/explanation.
Firstly, are you telling me the * html hack does away with the conditional comments I've been using to achieve an elastic page?
Secondly the conditional comments (CCs) work for the page, that's not the real problem. The problem is getting the "deb-box" - yellow box at the top of the #content on the Home page - to behave likewise. No matter what I do, the box fixes at a width that is either too small at 1024 screen or it is fixed at a size where the right hand side is off screen and can't be accessed even though the rest of the page has obeyed the CCs and min/max-width. So your fix is aimed at the page, not the box which is where I need it. I think.
ETA: ...and yes I am throwing "um, stuff" at it hoping something...anything...will stick at this stage
It's not an elastic page,
It's not an elastic page, what Gary has shown and what you are using is known as 'fluid'
'Elastic' is where one uses em valees for widths allowing the widths to adjust themselves according to the users font size.
The star selector hack/filter was what we always used to ensure a ruleset was read by IE6 only, lattely CC found favour and the possibility of feeding a stylesheet to IE6 was possible reducing the need for the star selector, if your using CC then continue so, the star selector is still useful though if for instance you combine saay IE6 and 7 rules in one sheet.
This issues should really not be that great a problem, either reduce the width of the box or increase the min page width, alternatively remove all widths add margins using percentages so that the left /right are always the same distance from parent width and allow the min width to stop further narrowing, IE6/7 might well require hasLayout if this approach is followed.
Hi Hugo Elastic...ah I
Hi Hugo Elastic...ah I thought that the fluid referred to the sites where for instance the middle column of a 3-column layout could reduce to zero without the text ever stopping its wrapping. That's why I've referred to my sort of layout as "elastic" because it could shrink and grow and the text would stop wrapping at the point the scroll bars kicked in.
Hmmm...I've managed so far to avoid separate style sheets for IE - and if it's at all possible, I would prefer to do so, though I can see it will become more difficult as time marches on. Scares me a bit, it's hard enough making one work!!
*big sigh* I know it shouldn't be a problem but it does seem to be. Since I've tried various combinations of your first suggestion I'll go try the margins thing.