Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

contact us page


  • Please log in to reply
10 replies to this topic

#1 dragonking

dragonking

  • Members
  • 10 posts
  • OFFLINE
  •  
  • Local time:12:06 PM

Posted 19 June 2012 - 05:44 PM

Hi all
I have this problem, I have installed a contact page on my web site it works well in IE, But will not work in Firefox & Opera. I am using coffee cup form builder v8.2... have goggled for weeks now no joy ... Please can anyone help

dragonking

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:11:06 AM

Posted 19 June 2012 - 06:33 PM

We would love to help, but since we have no clue how you tried to implement it, we have no clue how to help. It would be helpful if you showed us the relevant code. :)

#3 dragonking

dragonking
  • Topic Starter

  • Members
  • 10 posts
  • OFFLINE
  •  
  • Local time:12:06 PM

Posted 20 June 2012 - 07:37 AM

the code is this broken up into sections using ---------------------------- "its long"

/**Form page */


<script type="text/javascript" src="swfobject.js"></script>
<div id="CC9500187">Form Object</div>
<script type="text/javascript">var so = new SWFObject("jefssweater.swf", "jefssweater.xml", "750", "450", "7,0,0,0", "#ffffff");
so.addParam("classid", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000");
so.addParam("quality", "high");
so.addParam("scale", "noscale");
so.addParam("salign", "lt");
so.addParam("FlashVars", "xmlfile=jefssweater.xml&w=750&h=450");
so.write("CC9500187");
</script>

-------------------------------------------------------------------------------------------------

/**
* SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
*
* SWFObject is © 2007 Geoff Stearns and is released under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
*/
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}
this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}
if©{this.addParam("bgcolor",c);}
var q=_7?_7:"high";this.addParam("quality",q);
this.setAttribute("useExpressInstall",false);
this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);
this.setAttribute("redirectUrl","");
if(_9){this.setAttribute("redirectUrl",_9);}};
deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

-----------------------------------------------------------------------------------------------------------------------

"XML DOC"

<?xml version="1.0" encoding="UTF-8"?>

<form url="jefssweater.php"
window="_self"
method="POST"
fontname="MS Sans Serif"
width="750"
height="450"
bkcolor="0xFFFFFF"
transparent="f"
fontcolor="0x000000"
outlinecolor="0x000000"
themecolor="0xFFFF99"
fontcolor2="#000000"
bkcolor2="#FFFFFF"
includeresults="false"
emailuser="true"
verifymessage="The E-Mail address you entered does not match !"
reqmessage="One or More Fields are Required"
invalidemailmsg="does not appear to be a valid e-mail address. Would you like to change it?"
transition="4"
autoresponseincluderesults="f"
autoresponseaddtotop="f"
usephp="true"
disableclicktoactiveprompt="true"
extensions="*.txt;*.gif;*.jpg;*.jpeg;*.zip;*.doc;*.png;*.pdf;*.rtf"
>

<hidden
name="subject"
value="My Contact Form"
></hidden>

<image
image="butterfly.jpg"
x="0"
y="0"
bk="true"
></image>

<textinput
name="name"
x="25"
y="75"
w="320"
h="22"
initvalue=""
bkcolor="0xFFFFFF"
fontname="Arial"
fontcolor="0x000000"
required="true"
editable="true"
>
</textinput>

<textinput
name="Email Address"
x="25"
y="125"
w="321"
h="22"
initvalue=""
bkcolor="0xFFFFFF"
fontname="Arial"
fontcolor="0x000000"
required="true"
emailbox="true"
editable="true"
restrict="email"
>
</textinput>

<textarea
name="comment"
x="25"
y="225"
w="424"
h="120"
initvalue=""
maxchars="1000"
wordwrap="true"
required="true"
editable="true"
bkcolor="0xFFFFFF"
fontsize="12"
fontname="Arial"
fontcolor="0x000000"
></textarea>

<submitbutton
name="Submit Button"
x="25"
y="350"
w="119"
h="47"
label="send"
fontname="Georgia"
fontcolor="0x000000"
image="submit_btt.png"
fontsize="12"
></submitbutton>

<label
name="My Text 1"
x="25"
y="200"
w="118"
h="19"
text="Your Message:"
fontbold="bold"
fontname="Arial CE"
fontcolor="0xFFFFFF"
fontsize="16"
></label>

<label
name="My Text 2"
x="25"
y="150"
w="68"
h="19"
text="Subject:"
fontbold="bold"
fontname="Arial CE"
fontcolor="0xFFFFFF"
fontsize="16"
></label>

<label
name="My Text 3"
x="25"
y="100"
w="164"
h="19"
text="Your E-Mail Address:"
fontbold="bold"
fontname="Arial CE"
fontcolor="0xFFFFFF"
fontsize="16"
></label>

<label
name="My Text 4"
x="25"
y="50"
w="94"
h="19"
text="Your Name:"
fontbold="bold"
fontname="Arial CE"
fontcolor="0xFFFFFF"
fontsize="16"
></label>

<label
name="My Text 5"
x="500"
y="0"
w="211"
h="28"
text="Contact Our Company"
fontbold="bold"
fontname="Monotype Corsiva"
fontcolor="0xFFFFFF"
fontsize="23"
></label>

<resetbutton
name="Reset Button"
x="625"
y="350"
w="119"
h="47"
label="Reset"
fontname="Arial"
fontcolor="0x000000"
image="reset_btt.png"
fontsize="12"
></resetbutton>

<label
name="My Text 6"
x="275"
y="150"
w="84"
h="19"
text="Post Code"
fontbold="bold"
fontname="Arial CE"
fontcolor="0xFFFFFF"
fontsize="16"
></label>

<textinput
name="Post Code"
x="275"
y="175"
w="84"
h="22"
initvalue=""
maxchars="8"
bkcolor="0xFFFFFF"
fontname="Arial"
fontcolor="0x000000"
required="true"
editable="true"
>
</textinput>

<combobox
name="Subject"
x="25"
y="175"
bkcolor="0xFFFFFF"
fontcolor="0x000000"
required="true"
isemail="false"
w="232"
h="20">
<item name="None"></item>
<item name="Domestic Cleaning"></item>
<item name="Carpet Cleaning"></item>
<item name="Oven Cleaning"></item>
<item name="Spring Cleaning"></item>
<item name="End of Tenancy"></item>
<item name="Party Clean up"></item>
<item name="Builder Clean Up"></item>
</combobox>

</form>

-----------------------------------------------------------------------------------------------------------------------------------------------------------

<?php
/**
* CoffeeCup Flash Form Builder: Form Results Handler
*
* This file is in charge of handling the form results
* posted from the CoffeeCup Flash Form Builder SWF.
* It has several primary functions:
*
* - Assure that the user is running the proper version of
* PHP and has properly configured their server for
* CoffeeCup Flash Form Builder by uploading the provided
* files and assigning the appropriate server settings
* and permissions.
* - Upload a file if the '$_FILES['Filedata']' variable is
* populated
* - If the '$_POST' superglobal array has been populated,
* process the form by:
* - Reading the config file provided in the '$_POST['xmlfile']'
* variable.
* - Saving the form data to a file if the 'CC_FB_SAVE_FILE' constant
* has been populated.
* - Saving the form data to the database provided in 'CC_FB_DB_ADDRESS'
* if the 'CC_FB_DB_ADDRESS' constant is populated.
* - Emailing the form data to the form owner via the address provided
* in the '$_POST['_ALT_EMAIL']' variable or the '$_POST['mailto']'
* variable if the '$_POST['_ALT_EMAIL']' variable is not populated.
* - Emailing the form data to the form user via the address provided in
* the '$_POST['eM']' variable if the '$_POST['eM']' variable has been
* populated and the 'emailuser' config option is set to 'true'.
* - Taking the form user to the landing page provided in the
* '$_POST['thankyoupage']' variable or to a default landing page
* if the '$_POST['thankyoupage']' is empty.
* - Prints out an informational page with version numbers and release
* dates if an error occurs or if this script is called without
* the '$_POST' superglobal or the '$_FILES['Filedata']' variables
* being set.
*
* @license http://www.coffeecup.com/legal/eula.html
* @author Jeff Welch <jw@coffeecup.com>
* @version 4.0
* @package CC_FB
*/

// Error reporting should be disabled in favor of
// our customer error messages.
error_reporting(0);

/**
* The version of CoffeeCup Flash Form Builder that
* generated this script.
*/
define('CC_FB_VERSION', '8.0');
/**
* The release date of the version of CoffeeCup Flash Form
* Builder that generated this script.
*/
define('CC_FB_LAST_UPDATED', '08/31/2007');

/**
* The version of this script.
*/
define('CC_FB_SCRIPT_VERSION', '5.0');
/**
* The release date of this script.
*/
define('CC_FB_SCRIPT_LAST_UPDATED', '02/25/2009');

/**
* Will the owner of this form be emailed the
* form data
*/
define('CC_FB_DO_EMAIL',true);
/**
* To default To address.
*/
define('CC_FB_TO_EMAIL', 'stephen.taylor12@tiscali.co.uk');
/**
* The default CC address.
*/
define('CC_FB_CC_EMAIL', '');
/**
* The default BCC address.
*/
define('CC_FB_BCC_EMAIL', '');
/**
* The message to send to the form owner
*/
define('CC_FB_OWNER_MESSAGE', '[FORMOWNERMSG]');

/**
* If we should send a message back to the user.
*/
define('CC_FB_AUTO_REPLY', true);
/**
* The subject of the message to be sent to the user.
*/
define('CC_FB_AUTO_REPLY_SUBJECT', 'Thank You!');
/**
* If we should include the form results
* in the message we send to the user.
*/
define('CC_FB_AUTO_REPLY_FORM_RESULTS', false);
/**
* The position of the auto-reply message
* in the email.
*/
define('CC_FB_AUTO_REPLY_POSITION', 'bottom');

/**
* The page to redirect to after the form is submitted.
*/
define('CC_FB_RESULTS_REDIRECT', '[RESULTSREDIRECT]');

/**
* The address of the database where the form results
* will be saved.
*/
define('CC_FB_DB_ADDRESS', '[ADDRESS]');
/**
* The port number of the database where the form results
* will be saved.
*/
define('CC_FB_DB_PORT', '[DBPORT]');
/**
* The username for the database where the form results
* will be saved.
*/
define('CC_FB_DB_USERNAME', '[DBUSER]');
/**
* The password for the database where the form results
* will be saved.
*/
define('CC_FB_DB_PASSWORD', '[DBPASS]');
/**
* The name of the database where the form results
* will be saved.
*/
define('CC_FB_DB_NAME', '[DBNAME]');
/**
* The name of the database table where the form results
* will be saved.
*/
define('CC_FB_DB_TABLE', '[DBTABLE]');

/**
* The file to log the form results to if necessary.
*/
define('CC_FB_SAVE_FILE', '[FILENAME]');

/**
* The filetypes that are acceptable for file uploads.
*/
define('CC_FB_ACCEPTABLE_FILE_TYPES', 'txt|gif|jpg|jpeg|zip|doc|png|pdf|rtf|html|docx|xsls');
/**
* The directory where files are uploaded
*/
define('CC_FB_UPLOADS_DIRECTORY', 'files');
/**
* The extension that gets added to file uploads
*/
define('CC_FB_UPLOADS_EXTENSION', '_fbu');
/**
* Will we save the file uploads to the server
*/
define('CC_FB_ATTACHMENT_SAVETOSERVER',true);
/**
* Will we save the file uploads to the db
*/
define('CC_FB_ATTACHMENT_SAVETODB',false);
/**
* Will we send the file upload as an attachment
*/
define('CC_FB_ATTACHMENT_ADDTOEMAIL',false);
/**
* Sendmail Message EOL's
*/
define('CC_FB_SENDMAIL_EOL',"\r\n");

// Makes sure that the user is using the required version
// of PHP as specified by {@link CC_FB_PHP_VERSION}.
if(!version_compare(PHP_VERSION, CC_FB_PHP_VERSION, '>='))
{
printMessage('Invalid PHP Version',
"We're sorry but CoffeeCup Form Builder requires PHP version " .
CC_FB_PHP_VERSION . ' or greater. Please contact your server ' .
'administrator.');
}
// Strip slashes if the server has magic quotes enabled.
if(get_magic_quotes_gpc())
{
$_POST = array_map("stripslashes", $_POST);
}
// John will need to fix this in the swf file.
foreach($_POST as $key => $value)
{
$_POST[str_replace('_', ' ', $key)] = $value;
}
// Let's sanitize the to field before it gets us in any trouble.
$_POST['eM'] = preg_replace("/(\n|\r|%0A|%0D)/i", '', $_POST['eM']);

// If the '$_FILES['Filedata']' is populated, process the
// file upload.
if(isset($_FILES['Filedata']))
{
processFileUpload();
}
// If the '$_POST' superglobal array is populated,
// process the form results.
elseif(is_array($_POST) && count($_POST) > 0)
{
processMailForm();
}
// If all else fails, print out a blank page with version
// numbers and release dates.
printMessage();


/**
* Process the mail form results.
*
* This method is in charge of processing the mail form which
* is posted from the CoffeeCup Flash Form Builder SWF. This
* process includes:
*
* - Retrieving the preferences from the included CoffeeCup Flash
* Form Builder XML preferences file.
* - Formats output for file output as well as for an email to
* the form user and the form owner as necesarry.
* - Writes output to a file and sends it to the form user and
* the form owner as necessary.
* - Writes form results to a database if necesarry.
*/
function processMailForm()
{
fixUploadedFileName();
$preferences = getPreferences();

foreach($preferences['form_fields'] as $key => $value)
{
if(trim($_POST[$key]) != '')
{
$owner_email_response .= "$key: {$_POST[$key]}\n\n";
$txt_file .= "$key: {$_POST[$key]}|";

// Make sure we aren't displaying hidden fields
// to end-users
if($value['type'] != 'hiddenfield')
{
$user_email_response .= "$key: {$_POST[$key]}\n\n";
$form_response .= "$key: {$_POST[$key]}<br/>\n";
}
}
}

// If a file was uploaded, add the appropriate data to the response
// fields
if($_POST['Uploaded_File'] != "")
{
$owner_email_response .= "Uploaded File: {$_POST['Uploaded_File']}";
$user_email_response .= "Uploaded File: {$_POST['Uploaded_File']}";

$form_response .= " Uploaded File: {$_POST['Uploaded_File']}" .
"<br/>\n";
$txt_file .= "Uploaded File: {$_POST['Uploaded_File']}|";
}

sendResponseEmails($owner_email_response, $user_email_response,
$preferences);
writeResponseToFile($txt_file);
writeResponseToDatabase($preferences);

// Make sure we delete the file from the server if the user doesn't
// want it
if(!CC_FB_ATTACHMENT_SAVETOSERVER && $_POST['Uploaded_File'] != '')
{
@unlink(CC_FB_UPLOADS_DIRECTORY . "/{$_POST['Uploaded_File']}");
}

printResponsePage($form_response, $preferences);
}


/**
* Send response emails to the appropriate recipients.
*
* Sends an email to the scripts owner as well as the end-user
* if appropriate. If the sending of mail fails, an error
* message will be printed out to the screen.
*
* @param string $owner_email_response the message to mail to the owner.
* @param string $user_email_response the message to mail to the user.
* @param array $preferences the CoffeeCup Flash Form Builder Preferences.
*/
function sendResponseEmails($owner_email_response, $user_email_response,
$preferences)
{
// If the program is unregistered, add the unregistered message.
if($_POST['unreg'])
{
$unreg = "------------------------\n" .
"This Form was sent to you using CoffeeCup Form Builder." .
"\nPlease tell a friend about us: " .
"http://www.coffeecup.com/form-builder/";
}

// Set up the CC field if necessary
if(CC_FB_CC_EMAIL != '')
{
$cc = 'Cc: ' . CC_FB_CC_EMAIL . CC_FB_SENDMAIL_EOL;
}

// Set up the BCC field if necessary
if(CC_FB_BCC_EMAIL != '')
{
$bcc = 'Bcc: ' . CC_FB_BCC_EMAIL . CC_FB_SENDMAIL_EOL;
}

// Use the alternative email if one is provided
$mail_to = ($_POST['_ALT_EMAIL'] != '' ? $_POST['_ALT_EMAIL'] :
CC_FB_TO_EMAIL);

// Set a default subject if one is not provided
$subject = ($_POST['subject'] != '' ? parseMessage($_POST['subject'], $preferences) :
'Form Submission');

// Set up the default mail headers
$headers = 'MIME-Version: 1.0' . CC_FB_SENDMAIL_EOL .
'Content-Type: text/plain; charset=utf-8' . CC_FB_SENDMAIL_EOL .
'Content-Transfer-Encoding: 7bit' . CC_FB_SENDMAIL_EOL;

// Set up the default owner message if on is not provided
if(CC_FB_OWNER_MESSAGE == '[FORMOWNERMSG]')
{
$form_owner_msg =
'Here is the information submitted to ' .
"{$_SERVER['SERVER_NAME']}{$_SERVER['PHP_SELF']} from " .
"{$_SERVER['REMOTE_ADDR']} on " . date("l, F dS, Y \a\\t g:i a") .
".\n------------------------\n$owner_email_response$unreg";
}
else
{
$form_owner_msg = parseMessage(CC_FB_OWNER_MESSAGE, $preferences);
}

// Add the uploaded file as an attachment if the user has
// request we do so
if(CC_FB_ATTACHMENT_ADDTOEMAIL && $_POST['Uploaded_File'] != '')
{
if(!($contents =
file_get_contents(CC_FB_UPLOADS_DIRECTORY .
"/{$_POST['Uploaded_File']}")))
{
printMessage('Unable To Open Attachment File',"We're sorry but " .
'we were unable to open your uploaded file to attatch it for ' .
'email. Please be sure that you have the proper permissions.');
}

$attachment = chunk_split(base64_encode($contents));

// Setup the unique mime boundary
$mime_boundary = md5(time());

// Set up the form owner mail headers
$form_owner_headers = 'MIME-Version: 1.0' . CC_FB_SENDMAIL_EOL .
'Content-Type: multipart/mixed; ' .
"boundary=\"$mime_boundary\"" .
CC_FB_SENDMAIL_EOL;

// Set up the new form owner message
$form_owner_msg =
CC_FB_SENDMAIL_EOL .
"--$mime_boundary" . CC_FB_SENDMAIL_EOL .
'Content-Type: text/plain; charset=utf-8' . CC_FB_SENDMAIL_EOL .
'Content-Transfer-Encoding: 7bit' .
CC_FB_SENDMAIL_EOL. CC_FB_SENDMAIL_EOL .
$form_owner_msg .
CC_FB_SENDMAIL_EOL. CC_FB_SENDMAIL_EOL .
"--$mime_boundary" . CC_FB_SENDMAIL_EOL .
'Content-Type: application/octet-stream ' .
"name=\"{$_POST['Uploaded_File']}\"" . CC_FB_SENDMAIL_EOL .
"Content-Transfer-Encoding: base64" . CC_FB_SENDMAIL_EOL .
"Content-Description: {$_POST['Uploaded_File']}" .
CC_FB_SENDMAIL_EOL .
"Content-Disposition: attachment; " .
"filename=\"{$_POST['Uploaded_File']}\"" .
CC_FB_SENDMAIL_EOL . CC_FB_SENDMAIL_EOL .
"$attachment" . CC_FB_SENDMAIL_EOL. CC_FB_SENDMAIL_EOL;
"--$mime_boundary--" .
CC_FB_SENDMAIL_EOL . CC_FB_SENDMAIL_EOL;
}
else
{
$form_owner_headers = $headers;
}

// If we collected the end-user's email
if($_POST['eM'])
{
// Get all the headers without the From: portion
// so that we can do something fancy if the first
// attempt to send the message fails
$headers_without_from =
"Reply-To: {$_POST['eM']}" . CC_FB_SENDMAIL_EOL .
"Return-Path: {$_POST['eM']}" . CC_FB_SENDMAIL_EOL .
"$cc$bcc" .
'Message-ID: <' . time() . "-{$_POST['eM']}>" . CC_FB_SENDMAIL_EOL .
'X-Mailer: PHP v' . phpversion() . CC_FB_SENDMAIL_EOL .
$form_owner_headers;

// Send a message to the form's owner with the end-user's email
// as the reply-to address.
if(CC_FB_DO_EMAIL &&
!(mail($mail_to,$subject, $form_owner_msg,
"From: {$_POST['eM']}" . CC_FB_SENDMAIL_EOL .
$headers_without_from)) &&
!(mail($mail_to,$subject, $form_owner_msg,
'From: CoffeeCup Flash Form Builder ' .
"<formbuilder@{$_SERVER['SERVER_NAME']}>" . CC_FB_SENDMAIL_EOL .
$headers_without_from)))
{
printMessage('Unable To Send E-Mail',
"We're sorry but we were unable to send your e-mail. " .
'If you are sure that you entered all your email ' .
'addresses properly, you should contact your server ' .
'administrator.');
}

// If necesarry, send a message to the end-user as well.
if(CC_FB_AUTO_REPLY)
{
$form_user_msg = parseMessage('Thank you for e-mailing us. We will reply as soon as possible.
', $preferences);
$form_user_subject = parseMessage(CC_FB_AUTO_REPLY_SUBJECT, $preferences);

if(CC_FB_AUTO_REPLY_FORM_RESULTS)
{
$form_user_msg = CC_FB_AUTO_REPLY_POSITION == 'top' ?
"$form_user_msg\n\n$user_email_response" :
"$user_email_response\n\n$form_user_msg";
}

// Get all the headers without the From: portion
// so that we can do something fancy if the first
// attempt to send the message fails
$headers_without_from =
"Reply-To: $mail_to" . CC_FB_SENDMAIL_EOL .
"Return-Path: $mail_to" . CC_FB_SENDMAIL_EOL .
'Message-ID: <' . time() . "-$mail_to>" .
CC_FB_SENDMAIL_EOL .
'X-Mailer: PHP v' . phpversion() . CC_FB_SENDMAIL_EOL .
$headers;

mail($_POST['eM'],$form_user_subject,
"$form_user_msg$unreg",
"From: $mail_to" . CC_FB_SENDMAIL_EOL .
$headers_without_from) ||
mail($_POST['eM'],$form_user_subject,
"$form_user_msg$unreg",
"From: {$_SERVER['SERVER_NAME']} Form " .
"<forms@{$_SERVER['SERVER_NAME']}>" . CC_FB_SENDMAIL_EOL .
$headers_without_from);
}
}
// Send a message to the form's owner.
elseif(CC_FB_DO_EMAIL && !(mail($mail_to,$subject,
$form_owner_msg,
'From: CoffeeCup Flash Form Builder ' .
"<formbuilder@{$_SERVER['SERVER_NAME']}>" . CC_FB_SENDMAIL_EOL .
"$cc$bcc" .
'Message-ID: <' . time() .
"-formbuilder@{$_SERVER['SERVER_NAME']}>" . CC_FB_SENDMAIL_EOL .
'X-Mailer: PHP v' . phpversion() . CC_FB_SENDMAIL_EOL .
$form_owner_headers)))
{
printMessage('Unable To Send E-Mail',
"We're sorry but we were unable to send your e-mail. " .
'If you are sure that you entered all your email ' .
'addresses properly, you should contact your server ' .
'administrator.');
}
}


/**
* Parses owner-defined email message
*
* Loops through posted form values and replaces all form
* elements in the $message with their corresponding values.
*
* @param string $message an owner-defined email message
* @param array $preferences the CoffeeCup Flash Form Builder Preferences.
*/
function parseMessage($message, $preferences)
{
foreach($preferences['form_fields'] as $key => $value)
{
$message = str_replace('[' . $key . ']', $_POST[$key], $message);
}

return $message;
}


/**
* Gets the real name of the file that was uploaded.
*
* Since the file upload occurs in a different request,
* this method helps us resolve what the name of the
* uploaded file was in case it was renamed.
*/
function fixUploadedFileName()
{
if($_POST['Uploaded_File'] != '')
{
$extension = substr($_POST['Uploaded_File'],
strrpos($_POST['Uploaded_File'], '.'));
$basename = basename($_POST['Uploaded_File'], $extension);

while(file_exists(CC_FB_UPLOADS_DIRECTORY . "/$basename".
CC_FB_UPLOADS_EXTENSION . "$i$extension"))
{
$new_upload_name = "$basename". CC_FB_UPLOADS_EXTENSION .
"$i$extension";
$i++;
}

}
$_POST['Uploaded_File'] = $new_upload_name;
}


/**
* Write form response to a database.
*
* Writes the form response to the database specified at 'CC_FB_DB_ADDRESS'
* if appropriate. If the database doesn't it exist, the CC_FB_DB_TABLE
* table doesn't exist or if the CC_FB_DB_TABLE table doesn't comply with
* the structure of the current form then the database will be restructured
* accordingly.
*
* @param array $preferences the CoffeeCup Flash Form Builder Preferences.
*/
function writeResponseToDatabase($preferences)
{
// If the CC_FB_DB_ADDRESS constant has been populated, then
// the user wants to write their data to a database.
if(CC_FB_DB_ADDRESS != '[ADDRESS]')
{
// First and foremost, lets make sure they have the mysql extension
// loaded.
if(!extension_loaded('mysql'))
{
printMessage('Unable to use MySQL',
"We're sorry but you must have the MySQL extensions loaded " .
'in your PHP configuration in order to save your form '.
'results to a MySQL database. Please contact your ' .
'server administrator.');
}
// Secondly, lets make sure we can connect to their database.
elseif(!($link =
mysql_connect(CC_FB_DB_ADDRESS . ':' . CC_FB_DB_PORT,
CC_FB_DB_USERNAME, CC_FB_DB_PASSWORD)))
{
printMessage('Unable to Connect to Database Server.',
"We're sorry but we were unable to connect to your database " .
'server. Please be sure you have entered your database ' .
'settings correctly.');
}
// If we can't select their DB, lets try to create our own.
elseif(!mysql_select_db(CC_FB_DB_NAME, $link))
{
if(!mysql_query('CREATE DATABASE ' . CC_FB_DB_NAME, $link))
{
printMessage('Unable to Create Database.',
"We're sorry but we were unable to create your database. " .
'If you believe the database already exists, please ' .
'be sure that you have the proper permissions to ' .
'select it. Otherwise, please be sure that you ' .
'have permissions to create databases. If you ' .
'are still experiencing troubles, please contact ' .
'your server administrator.');
}
elseif(!mysql_select_db(CC_FB_DB_NAME, $link))
{
printMessage('Unable to select Database.',
"We're sorry but we were unable to select your database. " .
'Please be sure that you have the proper permissions to ' .
'select it. If you are still experiencing trouble, ' .
'please contact your server administrator.');
}
}

// If a form_results table exists, make sure it is in the
// proper format.
if(mysql_num_rows(mysql_query("SHOW TABLES LIKE '" . CC_FB_DB_TABLE .
"'", $link)) != 0)
{
if(!($results = mysql_query('SHOW COLUMNS FROM `' . CC_FB_DB_TABLE .
'`', $link)))
{
printMessage('Unable to Query Database.',
"We're sorry but we were unable to query your database " .
'table. Please be sure that you have the proper ' .
'permissions to select from the ' . CC_FB_DB_TABLE .
' table. If you are still experiencing trouble, ' .
'please contact your server administrator.');
}

while($row = mysql_fetch_assoc($results))
{
if($row['Field'] != 'id' && $row['Field'] != 'created_at')
{
$columns[$row['Field']] = $row;
}
}

if(!formFieldsEqualsTableFields($preferences['form_fields'],
$columns))
{
archiveOldTable($link);
createTableFromFormFields($preferences['form_fields'], $link);
}
}
// Otherwise create the CC_FB_DB_TABLE table in the proper format.
else
{
createTableFromFormFields($preferences['form_fields'], $link);
}

// If all went well, lets attempt to write the form results to
// the database.
foreach($preferences['form_fields'] as $field_name => $field)
{
$query .= "`$field_name` = " .
mysqlEscape($_POST[$field_name], $link) . ',';
}

// Add the uploaded file to the query if necessary
if(CC_FB_ATTACHMENT_SAVETODB)
{
if($_POST['Uploaded_File'] != '')
{
if(!($contents =
file_get_contents(CC_FB_UPLOADS_DIRECTORY .
"/{$_POST['Uploaded_File']}")))
{
printMessage('Unable To Open Attachment File',"We're sorry " .
'but we were unable to open your uploaded file to ' .
'attach it for email. Please be sure that you have the ' .
'proper permissions.');
}

$query .= '`uploaded_file_name` = ' .
mysqlEscape($_POST['Uploaded_File'], $link) . ',' .
'`uploaded_file` = ' . mysqlEscape($contents, $link) .
',';
}
else
{
$query .= "`uploaded_file_name` = '',`uploaded_file` = '',";
}
}

if(!mysql_query('INSERT INTO `' . CC_FB_DB_TABLE . '` SET ' .
$query . "`created_at` = NOW()", $link))
{
printMessage('Unable to Insert Into Database Table.',
"We're sorry but we were unable to insert the form results " .
'into your database table. Please be sure that you have ' .
'the proper permissions to insert data into the ' .
CC_FB_DB_TABLE . ' table. If you are still experiencing ' .
'trouble, please contact your server administrator.');
}
}
}


/**
* Archives an old `CC_FB_DB_TABLE` table.
*
* Renames a form results table to CC_FB_DB_TABLE_old or
* CC_FB_DB_TABLE_old with a numerical value on the end of it
* if appropriate.
*
* @param resource $link a database resource
*/
function archiveOldTable($link)
{
while(mysql_num_rows(mysql_query("SHOW TABLES LIKE '" . CC_FB_DB_TABLE .
"_old$i'", $link)) != 0)
{
$i++;
}

if(!(mysql_query("RENAME TABLE `" . CC_FB_DB_TABLE . "` TO `" .
CC_FB_DB_TABLE . "_old$i`", $link)))
{
printMessage('Unable to Rename Database Table.',
"We're sorry but we were unable to rename your database " .
'table. Please be sure that you have the proper ' .
'permissions to rename the ' . CC_FB_DB_TABLE . ' table' .
'. If you are still experiencing trouble, please contact your ' .
'server administrator.');
}
}


/**
* Escapes a value for MySQL.
*
* Prepares a value to be used safely in a MySQL query. If the value is
* numeric, it is returned. If the value is a string, it is quoted and
* escaped using the mysql_real_escape_string function.
*
* @param mixed $value the value to be escaped
* @param resource $link a database resource
* @return mixed $value the escaped value
*/
function mysqlEscape($value, $link)
{
return ("'" . mysql_real_escape_string($value, $link) . "'");
}


/**
* Checks if the columns from a table match the the structure
* of the fields from a form.
*
* @param array $form_fields the structure from the form
* @param array $table_fields the structure from the table
* @return boolean $value, true if the structures are the same,
* false if the structures are not.
*/
function formFieldsEqualsTableFields($form_fields, $table_fields)
{
// Make sure we have the proper fields for saving uploaded
// files to the database if the user has requested we do so
if(CC_FB_ATTACHMENT_SAVETODB)
{
if(array_key_exists('uploaded_file', $table_fields) &&
array_key_exists('uploaded_file_name', $table_fields))
{
unset($table_fields['uploaded_file_name']);
unset($table_fields['uploaded_file']);
}
else
{
return false;
}
}

if(count($form_fields) != count($table_fields))
{
return false;
}

foreach($form_fields as $field_name => $field)
{
if(!is_array($table_fields[$field_name]) ||
!(($field['type'] == 'textarea' &&
$table_fields[$field_name]['Type'] == 'text') ||
$table_fields[$field_name]['Type'] == 'varchar(255)'))
{
return false;
}
}

return true;
}


/**
* Create a MySQL table from the form structure.
*
* Uses the structure of the form, pulled from the XML preferences
* file to create a database table to store the form results.
*
* @param resource $form_fields the structure of the form
* @param resource $link a database resource
*/
function createTableFromFormFields($form_fields, $link)
{
mysql_query("DROP TABLE IF EXISTS `" . CC_FB_DB_TABLE . "`", $link);

$query = 'CREATE TABLE `' . CC_FB_DB_TABLE . '` (
`id` int(11) NOT NULL auto_increment,
`created_at` DATETIME NOT NULL';

if(CC_FB_ATTACHMENT_SAVETODB)
{
$query .= ",`uploaded_file_name` varchar(255) NOT NULL DEFAULT ''
,`uploaded_file` MEDIUMBLOB NOT NULL";
}

foreach($form_fields as $field_name => $field)
{
$query .= ",\n `$field_name` " .
($field['type'] == 'textarea' ? 'text' : 'varchar(255)') .
" NOT NULL DEFAULT ''";
}

if(!(mysql_query("$query, PRIMARY KEY(`id`))", $link)))
{
printMessage('Unable to Create Table.', "We're sorry but we were " .
'unable to create a database table for your form results. ' .
'Please be sure that you have the proper permissions to ' .
'create tables. If you are still experiencing trouble, ' .
'please contact your server administrator.');
}
}


/**
* Write form response to a log file.
*
* Writes the form response to the log file specified at 'CC_FB_SAVE_FILE'
* if appropriate. If the file writing fails, an error message will be
* printed out to the screen.
*
* @param string $txt_file the response to write to the log file.
*/
function writeResponseToFile($txt_file)
{
$txt_file = "{$_SERVER['SERVER_NAME']}{$_SERVER['PHP_SELF']}|" .
date("Y-m-d H:i:s") . "|{$_SERVER['REMOTE_ADDR']}|$txt_file\n";

// If a log file location has been set
if(CC_FB_SAVE_FILE != '[FILENAME]')
{
if($handle = fopen(CC_FB_SAVE_FILE, 'a'))
{
if(fwrite($handle, $txt_file) === false)
{
printMessage('Unable To Write To File',
"We're sorry but we were unable to write to ".CC_FB_SAVE_FILE.
'. Please contact your server administrator to be sure ' .
'that you have the proper permissions.');
}
fclose($handle);
}
else
{
printMessage('Unable To Open File',
"We're sorry but we were unable to open " . CC_FB_SAVE_FILE .
'. Please contact your server administrator to be sure ' .
'that you have the proper permissions.');
}
}
}


/**
* Prints the HTML-formatted, form response page for the end-user.
*
* Writes the form response to an HTML-formatted page for the end-user
* or redirects the user to a thank you page if specified.
*
* @param string $form_response the response to write to the page.
* @param array $preferences the CoffeeCup Flash Form Builder Preferences.
*/
function printResponsePage($form_response, $preferences)
{
// Redirect to a thank you page if the user has created one.
if(CC_FB_RESULTS_REDIRECT != '[RESULTSREDIRECT]')
{
die(header('Location: ' . CC_FB_RESULTS_REDIRECT));
}
// Otherwise create a thank you page.
else
{
$results_msg = '<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>Form Submitted</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex,nofollow" />
<style type="text/css">
<!--
body
{
text-align: center;
}
#message
{
width: 720px;
margin: 0 auto;
}
-->
</style>
</head>

<body>
<h2>Thank you for your form submission!</h2>
</body>';
die(str_replace('$form_results', $form_response,
$results_msg));
}
}


/**
* Returns the CoffeeCup Flash Form Builder Preferences.
*
* Opens the CoffeeeCup Flash Form Builder XML preferences file
* and retrieves the preferences and form fields from it. If
* the preferences file is not found or can not be opened, an
* error message is printed to the screen.
*
* @return array $preferences an array of preferences specified
* in the CoffeeCup Flash Form Builder XML preferences file.
*/
function getPreferences()
{
if(!($contents = file_get_contents($_POST['xmlfile'])))
{
printMessage('Unable To Open XML File',"We're sorry but we were " .
'unable to locate your XML file. Please be sure that the \'' .
"{$_POST['xmlfile']}' is on your server in the same directory " .
'as your other form builder files.');
}

// Strips out all the XML nodes from the preferences file.
preg_match_all('/<([a-z]+?)\s+(.*?)>/is', $contents, $nodes);

foreach($nodes[1] as $node_key => $node_value)
{
// Skip over item, hidden, button and label nodes, as we're not
// interested in them.
if($node_value != 'item' && $node_value != 'hidden' &&
$node_value != 'submitbutton' && $node_value != 'browsebutton' &&
$node_value != 'label' && $node_value != 'resetbutton')
{
$node_array = array();

// For each node, we will strip out all of the attributes
preg_match_all('/([a-z0-9]+?)="(.*?)"/is',
$nodes[2][$node_key], $attributes);
foreach($attributes[2] as $attribute_key => $attribute_value)
{
$node_array[$attributes[1][$attribute_key]] =
html_entity_decode($attribute_value);
}

// If the node has an attribute called 'name', it is a form field.
if(isset($node_array['name']))
{
$name = $node_array['name'] . ($node_array['label'] != '' ?
" - {$node_array['label']}" : '');
$preferences['form_fields'][$name] = $node_array;
$preferences['form_fields'][$name]['type'] = $node_value;
}
// If the node type is 'form', it is the form preferences
elseif($node_value == 'form')
{
$preferences['form_preferences'] = $node_array;
}
// otherwise just dump everything into a general array depending
// on its node type.
else
{
$preferences[$node_value][] = $node_array;
}
}
}

return $preferences;
}


/**
* Uploads a user-submitted file.
*
* Attempts to upload a user-submitted file specified in
* '$_FILES['Filedata']' to the 'CC_FB_UPLOADS_DIRECTORY' directory. If the
* file already exists, append a numeric value to the end of
* the file name.
*/
function processFileUpload()
{
if(!ini_get('file_uploads'))
{
printMessage('File Uploads Disabled',
"We're sorry but we were unable to upload your file because " .
'your do not have file uploads enabled. Please contact' .
'your server administrator.');
}

// Make sure we have a directory to store the file uploads
if(!is_dir(CC_FB_UPLOADS_DIRECTORY) &&
!mkdir(CC_FB_UPLOADS_DIRECTORY,0755))
{
printMessage('Directory Creation Failed',
"We're sorry but we were unable to create a directory for " .
'your file uploads. Please contact your server administrator.');
}
// Make sure the file upload is of an acceptable file type
if(CC_FB_ACCEPTABLE_FILE_TYPES != "" &&
!preg_match('/\.('.CC_FB_ACCEPTABLE_FILE_TYPES.')$/is',
$_FILES['Filedata']['name']))
{
printMessage('Invalid File Type',
"We're sorry but we were unable to upload your file because " .
'the file type is not acceptable.');
}

// Seperate the file's basename and extension so that
// we can append numeric values on the end of the basename
// if the file already exists.
$extension = substr($_FILES['Filedata']['name'],
strrpos($_FILES['Filedata']['name'], '.'));
$basename = basename($_FILES['Filedata']['name'], $extension);

// Append number values on the end of the file name
// if the file already exists
while(file_exists(CC_FB_UPLOADS_DIRECTORY . "/$basename" .
CC_FB_UPLOADS_EXTENSION . "$i$extension"))
{
$i++;
}

if(!move_uploaded_file($_FILES['Filedata']['tmp_name'],
CC_FB_UPLOADS_DIRECTORY . "/$basename". CC_FB_UPLOADS_EXTENSION .
"$i$extension"))
{
printMessage('File Upload Failed',
"We're sorry but we were unable to upload your file. Please " .
'contact your server administrator.');
}
chmod(CC_FB_UPLOADS_DIRECTORY . "/$basename$i$extension", 0777);
}


/**
* Prints a message to the screen.
*
* Prints an HTML-formatted message to the screen that also contains
* the current PHP version number the server is running, the current
* version number and release date of this script as well as the
* current version number and release date of the version of CoffeeCup
* Flash Form Builder that generated this script.
*
* NOTE: This function stops execution of the script.
*
* @param string $title the title of the page
* @param string $message the message to print to the screen
*/
function printMessage($title = null, $message = null)
{
// If the user has provided a title, format it for HTML
if($title !== null)
{
$title = htmlentities($title, ENT_QUOTES);
$page_title = "$title - ";
$title = "<h1>$title</h1>";
}

// If the user has provided a message, formit it for HTML
if($message !== null)
{
$message = '<p>' . htmlentities($message, ENT_QUOTES) . '</p>';
}

die( <<<EOHTML
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>{$page_title}CoffeeCup Form Builder</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex,nofollow" />
<style type="text/css">
<!--
div#script_info
{
border-top: 1px solid #666;
font-size: .85em;
}
-->
</style>
</head>

<body>
$title
$message
<div id="script_info">
<p>
PHP Version:
EOHTML
. PHP_VERSION . '
</p>
<p>
Sendmail Path: ' . ini_get('sendmail_path') . '<br />
Sendmail From: ' . ini_get('sendmail_from') . '<br />
SMTP: ' . ini_get('SMTP') . '<br />
SMTP Port: ' . ini_get('smtp_port') . '
</p>
<p>
MySQL: ' . (extension_loaded('mysql') ? 'Installed' : 'Not Installed') . '
</p>
<p>
File Uploads: ' . (ini_get('file_uploads') ? 'On' : 'Off') . '<br />
File Uploads Max Size: ' . ini_get('upload_max_filesize') . '<br />
Post Max Size: ' . ini_get('post_max_size') . '</p>
<p>
Software Version: ' . CC_FB_VERSION . '<br />
Software Last Updated: ' . CC_FB_LAST_UPDATED . '
</p>
<p>
Script Version: ' . CC_FB_SCRIPT_VERSION . '<br />
Script Last Updated: ' . CC_FB_SCRIPT_LAST_UPDATED . '
</p>' .
<<<EOHTML

</div>
</body>

</html>
EOHTML
);
}
?>


-----------------------------------------------------------------------------------------------------------------------------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /></head>
<body bgcolor="#FFFFFF"><center>
<script type="text/javascript" src="swfobject.js"></script><div id="CC3006851">Form Object</div><script type="text/javascript">var so = new SWFObject("jefssweater.swf", "jefssweater.xml", "750", "450", "7,0,0,0", "#ffffff");so.addParam("classid", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000");so.addParam("quality", "high");so.addParam("scale", "noscale");so.addParam("salign", "lt");so.addParam("FlashVars", "xmlfile=jefssweater.xml&w=750&h=450");so.write("CC3006851");</script>
</center></body></html>


-------------------------------------------------------------------------------------------------------------------------------------------

<?php

/**********
CC Mail Tester
Written by: CoffeeCup Software's David R.

A small PHP file that takes an e-mail address and uses the PHP
mail() function to test mailing. Does nothing more than send
the mail if everything is set correct, or return an error if not.
**********/

if($_POST['send_email']) {

// Check for a "to:" value. Exit if not available.
if(!$_POST['to']) {
die("You didn't type an e-mail address to send to! Please <a href=\"javascript:history.go(-1)\">go back</a> and try again.");
}

// Set the recipient.
$to = $_POST['to'];

// Set who it's from, if a value was entered.
if($_POST['from']) $from = $_POST['from'];

// Set the subject. If subject was left blank, override with a default.
$subject = $_POST['subject'];
if($_POST['subject'] == "") $subject = "CoffeeCup Test Message";

// Set the message. If the message was left blank, override with a default.
$message = htmlspecialchars(stripslashes($_POST['message']), ENT_NOQUOTES);
if($_POST['message'] == "") $message = "This is a test message from the CoffeeCup Software Mail Tester.";

// Set headers.
$charset = $_POST['charset'];
$headers = "Content-Type: text/plain; charset=".$charset."\r\n";
if($_POST['from']) $headers .= "From: ".$_POST['from']."\r\n";
if($from) $headers .= "Reply-To: ".$from."\r\n";
if($_POST['cc']) $headers .= "CC: ".$_POST['cc']."\r\n";
if($_POST['bcc']) $headers .= "BCC: ".$_POST['bcc']."\r\n";



// Send the e-mail.
$sent = mail($to, $subject, $message, $headers);

if(!$sent) { echo("<h2>Error sending mail.</h2>
<ul>
<li>First, <a href=\"javascript:history.go(-1)\">go back</a> and
make sure you typed a proper e-mail address. Here's what you typed: $to</li>
<li>If you're sure the above address is 100% correct, there's some setting on your web server that is not letting you send mail through PHP in a standard way. Perhaps your host requries a different method? Check with your web host to determine what this might be.</li>"); }
else echo("<h2>Mail appears to have been sent successfully.</h2><p>The
mail appears to have been sent properly! Good job! If you still do not receive this test message, be sure to check your spam or junk folders for it. Secondly, if you don't find the message in your junk mail or spam filters, you may need to contact your web host because it is likely a sendmail or other mail setting that needs to be looked at.</p>");
}
else { ?>

<html>
<head>
<style>
body {
font-family: Arial, Helvetica;
font-size: 12px;
width: 750px;
}

input, textarea {
border: 1px solid #9fbfff;
background-color: #eeeeee;
}

a:link {
text-decoration: none;
}

a:visited {
text-decoration: none;
}

a:hover {
text-decoration: underline;
}

.required {
color: green;
font-weight: bold;
}
</style>
<title>CCMT - CoffeeCup Mail Tester</title>
</head>
<body>
<?
if($_POST['authname']) {
$authname = $_POST['authname'];
$password = $_POST['password'];

if($authname == "freshsoftware" && $password == "20test08") {
?>

<h1>CoffeeCup Mail Tester</h1>

<p>This test mailer was created by <a href="http://www.coffeecup.com/">CoffeeCup Software</a> to test a Unix/Linux server's mailing capabilities.</p>

<p>Simply fill out an address below. <strong style="color: green">Only a To address is required.</strong></p>

<h2>Send the test</h2>

<form name="mailtester" method="POST" action="ccmt.php">
<table border="0" cellpadding="4" cellspacing="4">

<tr>
<td class="required" valign="top">To:</td>
<td><input type="text" name="to" size="70" /></td>
</tr>

<tr>
<td valign="top">CC:</td>
<td valign="top"><input type="text" name="cc" size="70" /></td>
</tr>

<tr>
<td valign="top">BCC:</td>
<td valign="top"><input type="text" name="bcc" size="70" /></td>
</tr>

<tr>
<td valign="top">Subject:</td>
<td valign="top"><input type="text" name="subject" size="70" /></td>
</tr>

<tr>
<td valign="top">Body:</td>
<td valign="top"><textarea name="message" rows="15" cols="69" /></textarea></td>
</tr>

<tr>
<td valign="top">From:</td>
<td valign="top"><input type="text" name="from" size="70" /></td>
</tr>

<tr>
<td valign="top">Charset:</td>
<td valign="top">
<select name="charset">
<option value="utf-8">utf-8 (Standard 8-bit)</option>
<option value="iso-8859-1">iso-8859-1 (West European)</option>
<option value="iso-8859-8">iso-8859-8 (Hebrew/Yiddish)</option>
<option value="iso-8859-9">iso-8859-9 (Turkish)</option>
<option value="iso-8859-10">iso-8859-10 (Nordic)</option>
</select></td>
</td>
</tr>
<tr>
<td></td>
<td valign="top"><input type="submit" value="Submit" /></td>
</tr>
</table>
<input type="hidden" name="send_email" value="true">
</form>

</body>
</html>
<?php
}
else { echo "Invalid username/password."; }
}
else { ?>

<form name="mailtesterauth" method="POST" action="ccmt.php">
<p>Who are you?<br />
<input type="text" name="authname" /></p>

<p>Prove it.<br />
<input type="password" name="password" /></p>

<p><input type="submit" value="Let me in." /></p>
</form>
</body>
</html>
<?
}
}
?>

--------------------------------------------------------------------------------------------------------------------------------------------------------


Hope anyone can help

#4 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:11:06 AM

Posted 20 June 2012 - 01:36 PM

Ok. How about any error messages,a description of the exact steps you are taking that causes the problem. Does it not respond? Have you tried installing the Firebug Plug-in for Firefox and debugging? Since you are using a 3rd party script to handle the email, have you checked to see if their is a site where you can get support? Do you have javascript disabled in Firefox and chrome?

There are millions of things that could be wrong, and we don't know what you have done beside googling the issue. Debugging cross browser issues can be difficult. :)

#5 dragonking

dragonking
  • Topic Starter

  • Members
  • 10 posts
  • OFFLINE
  •  
  • Local time:12:06 PM

Posted 20 June 2012 - 03:59 PM

Hi
This is the page that holds the contact form code link:- http://xxxxxxxxxxxxxxxxxxxxxxxxxxx ... If you use IE8 it works, But using firefox or Opera and I think all the other browser you just see the object.. I have inserted in the code my alternative email address when you use other browsers until I fix the issue in hand..
I don’t recive any error code just will not open.
On the coffee cup form builder forum there are lots of thoughts on this issue but none work...
Is there a page header to instruct Firefox to take note.
Thank
Steve

Edited by dragonking, 21 June 2012 - 06:57 AM.


#6 NpaMA

NpaMA

  • Members
  • 635 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Memphis, TN
  • Local time:01:06 PM

Posted 20 June 2012 - 04:05 PM

I'm using FireFox 13 (latest stable release) and it appears to work correctly. I just sent a test message through it and got "Thank you for your form submission!"

Posted Image

Is that how it's suppose to look/work?

#7 dragonking

dragonking
  • Topic Starter

  • Members
  • 10 posts
  • OFFLINE
  •  
  • Local time:12:06 PM

Posted 20 June 2012 - 04:55 PM

hi NpaMA
Yes thats the way it should behave and look "I recived your message" :thumbsup:
So it works in FF 13 That's great.. Thanks


I am concerned about all the other FF user's who have not got the latest FF

Thanks again

steve

#8 dragonking

dragonking
  • Topic Starter

  • Members
  • 10 posts
  • OFFLINE
  •  
  • Local time:12:06 PM

Posted 20 June 2012 - 05:33 PM

hi all
Just updated firefox and it still will not work for me :crazy:

#9 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:11:06 AM

Posted 20 June 2012 - 05:59 PM

Firefox worked fine for me also; I don't have any other browsers on this machine, so I can't say. The code works fine.

#10 KamakaZ

KamakaZ

  • Members
  • 739 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Victoria
  • Local time:04:06 AM

Posted 24 June 2012 - 07:56 PM

Have you tried clearing your cache? This gets me a bit with IE...

There's no place like 127.0.0.1
There are 10 types of people in the world, those that can read binary, and those who can't.


#11 MegaBeet

MegaBeet

  • Banned Spammer
  • 10 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:01:06 PM

Posted 03 July 2012 - 01:53 AM

I have also problem with Firefox.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users