<MIVA standardoutputlevel="html,text,compresswhitespace" errormessage=""> <MvComment> <HTML> <HEAD> <TITLE></TITLE> <TITLE></TITLE> <META http-equiv="refresh" content="0; url=&[SM_form_db.d.SM_resp]"> </HEAD> <BODY bgcolor="#FFFFFF"> ################################################################# This is simplemail.mv. A user-friendly Miva script to process mail generated by a plain HTML form that you create. Copyright 1998-1999 Simple Network Communications, Inc. Copyright 1999-2000 Yahoo!, Inc. All rights reserved. Developed on Miva Version 3.2211, November 1998 by Doug Barton, DougB@yahoo-inc.com. Release Version 1.6 Fully backwards compatible with previous SimpleMail versions. Now requires version 3.5 or greater of the Miva engine. Changelog: ========== Version 1.6, December 2000 1. Remove now-gratuitous whitespace reducing macros and use the compresswhitespace option instead. 2. Handle formatting of e-mail slightly differently so that the result looks the same as it used to. 3. Miscellaneous HTML and other cleanups. Version 1.5, March 2000 1. Remove Track-star banner Version 1.4, July 1999 1. Be even more cautious about From: e-mail addresses. 2. Strip spaces from URL's before db creation. 3. Improve performance on form submission error checking. Version 1.3, May 1999 1. Changed default From: address to first To: address to avoid remote sites rejecting the mail because of the fictitious From:. 2. Added target attributes to form and help URL's. 3. Converted to Miva's new (in 3.5) builtin isdigit() function. Version 1.2, March 1999 1. Fixed typo in e-mail address test. Version 1.1, January 1999 1. Improved documentation in response to user suggestions. 2. Made error messages more informative. 3. Slightly improved efficiency of form processing and database creation. 4. Added feature: "Is it an IP address?" attribute. 5. Added feature: If you use a custom response form, SimpleMail will use a META "refresh" tag to display it. This is both more efficient and helps hide the existence of SimpleMail from the end user. This feature can be turned off in the database modification form. ################################################################# First set some variables that we will use often </MvComment> <MvASSIGN name="SM_dir" value="simplemail"> <MvASSIGN name="SM_files" value="{SM_dir $ '/' }"> <MvASSIGN name="SM_admin_database" value="{SM_files $ 'sm_admin.dbf' }"> <MvASSIGN name="SM_form_list_database" value="{SM_files $ 'sm_form_list.dbf' }"> <MvASSIGN name="SM_documenturl" value="{substring(documenturl,1,len(documenturl)-1)}"> <MvASSIGN name="SM_crlf" value="{asciichar(13) $ asciichar(10)}"> <MvFUNCTION name="SM_header" parameters="SM_input_title"> <p> <Center><a href="http://website.yahoo.com/"> <img src="http://us.yimg.com/i/web/webst.gif" border="0" ALT="Yahoo! Website Services"></a> <H1>SimpleMail Administration</H1></Center> <HR size="5" width="90%"> </MvFUNCTION> <MvFUNCTION name="SM_std_FORM"> <FORM method="POST" action="&[SM_documenturl]"> <input type="hidden" name="SM_admin_name_good" value="&[SM_admin_name_good]"> <input type="hidden" name="SM_admin_password_good" value="&[SM_admin_password_good]"> </MvFUNCTION> <MvFUNCTION name="SM_footer"> <HR size="5" width="90%"> </form> End users don't need to know where they came from if there is an error. </MvCOMMENT> <MvFUNCTION name="SM_user_header" parameters="SM_input_title"> </MvFUNCTION> <MvFUNCTION name="SM_user_footer"> <p> "Main" loop to decide which subprocess to start. </MvComment> <MvIF EXPR="{ request_method CIN 'POST' }"> <MvIF EXPR="{ NOT SM_action }"> <MvEVAL EXPR="{SM_send_mail()}"> <MvELSE> <MvIF EXPR="{SM_action IN 'SM_admin_menu SM_create_admin_database SM_create_admin_database_screen SM_create_form_database_precheck SM_create_form_database_screen SM_delete_all_files SM_delete_all_files_screen SM_delete_form_database SM_delete_form_database_screen SM_fake_first_time_db SM_form_help SM_modify_form_database SM_modify_form_database_screen SM_update_form_database SM_validate_admin' }"> <MvEVAL EXPR="{&[SM_action]()}"> <MvELSE> <MvIF EXPR="{fexists(SM_admin_database)}"> <MvEVAL EXPR="{SM_validate_admin_screen()}"> <MvELSE> <MvEVAL EXPR="{SM_first_time_setup_screen()}"> </MvIF> </MvIF> </MvIF> <MvELSE> <MvIF EXPR="{SM_action AND (SM_action IN 'SM_form_helpSM_modify_form_database') }"> <MvEVAL EXPR="{&[SM_action]()}"> <MvELSE> <MvIF EXPR="{fexists(SM_admin_database)}"> <MvEVAL EXPR="{SM_validate_admin_screen()}"> <MvELSE> <MvEVAL EXPR="{SM_first_time_setup_screen()}"> </MvIF> </MvIF> </MvIF> <MvExit> <MvComment>End of the "Main" loop</MvComment> <MvFunction name="SM_send_mail" ERROROUTPUTLEVEL=""> <MvComment> First, open up the databases and check the attributes of the individual fields. If we find an error, send them to either a custom error URL provided by the user, or display the default error message. </MvComment> <MvASSIGN name="local.SM_URL_filename" value="{SM_files $ SM_URL_to_filename(http_referer)}"> <MvLOCKFILE file="{ local.SM_URL_filename $ '.dbf'}"> <MvOPEN name="SM_form_db" database="{ local.SM_URL_filename $ '.dbf'}"> <MvIF EXPR="{MvOPEN_Error}"> <MvASSIGN name="local.SM_db_error" value="{ MvOPEN_Error $ '<BR>'}"> </MvIF> <MvLOCKFILE file="{ local.SM_URL_filename $ '-att.dbf'}"> <MvOPEN name="SM_form_att_db" database="{ local.SM_URL_filename $ '-att.dbf'}"> <MvIF EXPR="{MvOPEN_Error}"> <MvASSIGN name="local.SM_db_error" value="{ local.SM_db_error $ MvOPEN_Error $ '<BR>'}"> </MvIF> <MvComment> If there was an error opening the databases, let the user know </MvComment> <MvIF EXPR="{ local.SM_db_error }"> <MvASSIGN name="SM_fatal_error" value="{ local.SM_db_error $ '<B>A database must be created for this form before it can be processed.</B>' }"> <MvEVAL EXPR="{SM_fatal_mail_error()}"> <MvExit> </MvIF> <MvGO name="SM_form_att_db" row="top"> <MvComment> Loop through attributes database and test end user's input Use nested IF's to improve performance since Miva tests both sides of an AND test even if the first fails </MvComment> <MvWHILE EXPR="{ NOT SM_form_att_db.d.EOF }"> <MvCOMMENT>Test to see if the value is mandatory</MvCOMMENT> <MvIF EXPR="{ SM_form_att_db.d.SM_mand }"> <MvIF EXPR="{ NOT &[SM_form_att_db.d.SM_name] }"> <MvASSIGN name="SM_mail_error" value="{SM_mail_error $ 'This field is mandatory: ' $ SM_form_att_db.d.SM_name $ '<BR>' }"> </MvIF> </MvIF> <MvComment>Now test the other values only if they exist</MvComment> <MvIF EXPR="{&[SM_form_att_db.d.SM_name]}"> <MvIF EXPR="{ SM_form_att_db.d.SM_digit }"> <MvIF EXPR="{ NOT isdigit( &[SM_form_att_db.d.SM_name] ) }"> <MvASSIGN name="SM_mail_error" value="{SM_mail_error $ 'You entered &quot;' $ &[SM_form_att_db.d.SM_name] $ '&quot; in a field that is supposed to have only a number<BR>' }"> </MvIF> </MvIF> <MvIF EXPR="{ SM_form_att_db.d.SM_email }"> <MvIF EXPR="{ substring(SM_clean_email_address( &[SM_form_att_db.d.SM_name] ),'1','5') EQ 'Error' }"> <MvASSIGN name="SM_mail_error" value="{SM_mail_error $ 'You entered &quot;' $ &[SM_form_att_db.d.SM_name] $ '&quot; in a field that is supposed to have only an e-mail address<BR>' }"> </MvIF> </MvIF> <MvIF EXPR="{ SM_form_att_db.d.SM_IP }"> <MvIF EXPR="{ ((gettoken(&[SM_form_att_db.d.SM_name],asciichar(46),1) LT '1') OR (gettoken(&[SM_form_att_db.d.SM_name],asciichar(46),1) GT '254') OR (gettoken(&[SM_form_att_db.d.SM_name],asciichar(46),2) LT '0') OR (gettoken(&[SM_form_att_db.d.SM_name],asciichar(46),2) GT '255') OR (gettoken(&[SM_form_att_db.d.SM_name],asciichar(46),3) LT '0') OR (gettoken(&[SM_form_att_db.d.SM_name],asciichar(46),3) GT '255') OR (gettoken(&[SM_form_att_db.d.SM_name],asciichar(46),4) LT '1') OR (gettoken(&[SM_form_att_db.d.SM_name],asciichar(46),4) GT '254')) }"> <MvASSIGN name="SM_mail_error" value="{SM_mail_error $ 'You entered &quot;' $ &[SM_form_att_db.d.SM_name] $ '&quot; in a field that is supposed to have only an IP address<BR>' }"> </MvIF> </MvIF> </MvIF> <MvSKIP name="SM_form_att_db"> </MvWHILE> <MvIF EXPR="{SM_mail_error}"> <MvEVAL EXPR="{SM_mail_input_error()}"> <MvExit> </MvIF> <MvComment> Ok, we didn't find any errors there, so let's get ready to send the mail </MvComment> <MvASSIGN name="local.SM_TO" value="{SM_form_db.d.SM_email}"> <MvComment> Loop through the attributes database replacing any &variable tags in the subject line or body with the value of that variable. </MvComment> <MvASSIGN name="local.SM_subject" value="{SM_form_db.d.SM_subject}"> <MvASSIGN name="local.SM_body" value="{SM_form_db.d.SM_format}"> <MvGO name="SM_form_att_db" row="bottom"> <MvWHILE EXPR="{ NOT SM_form_att_db.d.EOF }"> <MvASSIGN name="local.SM_subject" value="{ glosub(local.SM_subject, '&' $ SM_form_att_db.d.SM_name , &[SM_form_att_db.d.SM_name] )}"> <MvASSIGN name="local.SM_body" value="{ glosub(local.SM_body, '&' $ SM_form_att_db.d.SM_name , &[SM_form_att_db.d.SM_name] )}"> <MvSKIP name="SM_form_att_db" rows="-1"> </MvWHILE> <MvComment> Either use the plain text From: address from the db, or test the address entered by a user into an email field. </MvComment> <MvIF EXPR="{ '&' IN SM_form_db.d.SM_from EQ '1' }"> <MvASSIGN name="local.SM_from_pre" value="{ substring( SM_form_db.d.SM_from,2,160)}"> <MvASSIGN name="local.SM_from_pre" value="{ &[local.SM_from_pre] }"> <MvASSIGN name="local.SM_from" value="{SM_clean_email_address(local.SM_from_pre)}"> <MvIF EXPR="{ substring( local.SM_from,'1','5') EQ 'Error' }"> <MvASSIGN name="SM_mail_error" value="{ 'You entered &quot;' $ local.SM_from_pre $ '&quot; in a field that is supposed to have only an e-mail address<BR>' }"> <MvEVAL EXPR="{SM_mail_input_error()}"> <MvExit> </MvIF> <MvELSE> <MvASSIGN name="local.SM_from" value="{SM_form_db.d.SM_from}"> </MvIF> <MvASSIGN name="local.SM_topper" value="{'SimpleMail from your form at ' $ http_referer}"> <MvSMTP TO="{local.SM_TO}" SUBJECT="{local.SM_subject}" MAILHOST="mail.san.yahoo.com" FROM="{local.SM_from}"> <MvEVAL EXPR="{local.SM_topper}"> <MvEVAL EXPR="{SM_crlf}"> <MvIF EXPR="{ remote_addr }"> <MvASSIGN name="local.SM_remote_addr" value="{'Remote address of sender: ' $ remote_addr}"> <MvEVAL EXPR="{local.SM_remote_addr}"> </MvIF> <MvIF EXPR="{ remote_host }"> <MvASSIGN name="local.SM_remote_host" value="{'Remote hostname of sender: ' $ remote_host}"> <MvEVAL EXPR="{local.SM_remote_host}"> </MvIF> <MvIF EXPR="{ remote_user }"> <MvASSIGN name="local.SM_remote_user" value="{'Remote username of sender: ' $ remote_user}"> <MvEVAL EXPR="{local.SM_remote_user}"> </MvIF> <MvIF EXPR="{ remote_ident }"> <MvASSIGN name="local.SM_remote_ident" value="{'Remote ident of sender: ' $ remote_ident}"> <MvEVAL EXPR="{local.SM_remote_ident}"> </MvIF> <MvEVAL EXPR="{SM_crlf}"> <MvEVAL EXPR="{local.SM_body}"> </MvSMTP> <MvIF EXPR="{MvSMTP_Error}"> <MvASSIGN name="SM_SMTP_error" value="{MvSMTP_Error}"> </MvIF> <MvIF EXPR="{NOT SM_SMTP_error}"> <MvIF EXPR="{NOT SM_form_db.d.SM_resp}"> <MvEVAL EXPR="{SM_user_header('Form Processed Successfully')}"> <Center><H2><font color="#3366FF">Your form has been processed successfully. Thank you.</font></H2></Center> <MvEVAL EXPR="{SM_user_footer()}"> <MvELSE> <MvIF EXPR="{ NOT SM_form_db.d.SM_no_meta }"> <Center><H2><font color="#3366FF">Your form has been processed successfully. Thank you.</font></H2></Center> Loop through and replace all combinations of hard returns from various platforms so we can output the text from the message body to a file. </MvComment> <MvASSIGN name="local.SM_body" value="{glosub(local.SM_body,asciichar(13),asciichar(254))}"> <MvASSIGN name="local.SM_body" value="{glosub(local.SM_body,asciichar(10),asciichar(254))}"> <MvComment> Squish double tokens into one so that if the user has a hard return in their message body we get the whole message, and DOS users will have two anyway. </MvComment> <MvWHILE EXPR="{ asciichar(254) $ asciichar(254) IN local.SM_body }"> <MvASSIGN name="local.SM_body" value="{glosub(local.SM_body,asciichar(254) $ asciichar(254),asciichar(254)) }"> </MvWHILE> <MvASSIGN name="local.counter" value="1"> <MvWHILE EXPR="{ gettoken(local.SM_body,asciichar(254),local.counter)}"> <MvASSIGN name="local.SM_export" value="{ gettoken(local.SM_body,asciichar(254),local.counter)}"> <MvEXPORT file="{local.SM_URL_filename $ '-files' $ '/' $ SM_form_db.d.SM_filenum $ '.txt'}" FIELDS="local.SM_export" DELIMITER="{SM_crlf}"> <MvASSIGN name="local.counter" value="{local.counter + 1}"> </MvWHILE> <MvASSIGN name="SM_form_db.d.SM_filenum" value="{SM_form_db.d.SM_filenum + 1}"> <MvUpdate name="SM_form_db"> </MvIF> <MvCLOSE name="SM_form_att_db"> </MvLOCKFILE> <MvCLOSE name="SM_form_db"> </MvLOCKFILE> <MvExit> </MvFunction SM_send_mail> <MvFUNCTION name="SM_fatal_mail_error"> <MvLOCKFILE file="{SM_admin_database}"> <MvOPEN name="SM_admin_db" database="{SM_admin_database}"> <MvEVAL EXPR="{SM_user_header('Form Processing Failure')}"> <H2><font color="#FF0000">Error:</font></H2> Unfortunately, there was an error in the processing of your form. Please send an e-mail to &[SM_admin_db.d.SM_email:entities] with the following information: <A HREF="mailto:&[SM_admin_db.d.SM_email:entities]"> </a> <P><table border="0" align="center"> <tr><th align="left">URL of the form:</th><td><MvEVAL EXPR="{http_referer}"></td></tr> <tr><th align="left">Error message:</th><td><MvEVAL EXPR="{SM_fatal_error}"></td></tr></table> <P>Thank you for your patience, and sorry for any inconvenience. <MvEVAL EXPR="{SM_user_footer()}"> <MvCLOSE name="SM_admin_db"> </MvLOCKFILE> <MvExit> </MvFUNCTION SM_fatal_mail_error> <MvComment>Smash the URL into a database filename</MvComment> <MvFUNCTION name="SM_URL_to_filename" parameters="SM_input_URL"> <MvFUNCRETURN value="{ glosub(substring(local.SM_input_URL,(len('http://' $ gettoken(local.SM_input_URL,'/',3)) + 2),1000),'/','!')}"> </MvFUNCTION SM_URL_to_filename> <MvFunction name="SM_clean_email_address" parameters="SM_input_address"> <MvComment> Take an incoming string that should contain an e-mail address or addresses and format it for use with strict address format checking. First, convert tab to space, just in case they got one in there somehow. </MvComment> <MvIF EXPR="{ asciichar(9) IN local.SM_input_address }"> <MvASSIGN name="local.SM_input_address" value="{ glosub(local.SM_input_address,asciichar(9),asciichar(32)) }"> </MvIF> <MvIF EXPR="{ asciichar(32) IN local.SM_input_address }"> <MvComment> Be super paranoid, smash extra spaces </MvComment> <MvWHILE EXPR="{ asciichar(32) $ asciichar(32) IN local.SM_input_address }"> <MvASSIGN name="local.SM_input_address" value="{ glosub(local.SM_input_address,asciichar(32) $ asciichar(32),asciichar(32)) }"> </MvWHILE> <MvComment> Now convert single spaces to commas </MvComment> <MvASSIGN name="local.SM_input_address" value="{ glosub(local.SM_input_address,asciichar(32),asciichar(44)) }"> </MvIF> <MvComment> Just in case something weird happened, turn double commas into single </MvComment> <MvWHILE EXPR="{ asciichar(44) $ asciichar(44) IN local.SM_input_address }"> <MvASSIGN name="local.SM_input_address" value="{ glosub(local.SM_input_address,asciichar(44) $ asciichar(44),asciichar(44)) }"> </MvWHILE> <MvComment> Now we take the comma delimited list and make sure every item is valid and is enclosed in angle brackets. </MvComment> <MvASSIGN name="local.counter" value="1"> <MvWHILE EXPR="{ gettoken(local.SM_input_address,asciichar(44),local.counter)}"> <MvASSIGN name="local.SM_email_temp" value="{gettoken(local.SM_input_address,asciichar(44),local.counter)}"> <MvIF EXPR="{ NOT ('@' IN local.SM_email_temp)}"> <MvFUNCRETURN value="{'Error: &quot;' $ local.SM_email_temp $ '&quot; is not a valid e-mail address'}"> </MvIF> <MvIF EXPR="{ NOT ('.' IN gettoken(local.SM_email_temp,'@',2))}"> <MvFUNCRETURN value="{'Error: ' $ local.SM_email_temp $ ' is not a valid e-mail address because ' $ gettoken(local.SM_email_temp,'@',2) $ ' is not a valid hostname' }"> </MvIF> <MvIF EXPR="{('<' IN local.SM_email_temp) NE 1}"> <MvASSIGN name="local.SM_email_temp" value="{'<' $ local.SM_email_temp}"> </MvIF> <MvIF EXPR="{('>' EIN local.SM_email_temp) NE len(local.SM_email_temp)}"> <MvASSIGN name="local.SM_email_temp" value="{local.SM_email_temp $ '>'}"> </MvIF> <MvASSIGN name="local.SM_email_final" value="{local.SM_email_final $ local.SM_email_temp $ ','}"> <MvASSIGN name="local.counter" value="{local.counter + 1}"> </MvWHILE> <MvComment> Strip the trailing comma for neatness' sake </MvComment> <MvFUNCRETURN value="{substring(local.SM_email_final,1,len(local.SM_email_final)-1)}"> </MvFunction SM_clean_email_address> <MvFUNCTION name="SM_mail_input_error"> <MvIF EXPR="{SM_form_db.d.SM_error }"> <MvCALL action="{SM_form_db.d.SM_error}" method="GET"> <MvIF EXPR="{ ('##List of errors here##' CIN callvalue) EQ '' }"> <MvEVAL EXPR="{callvalue}"> <MvELSE> <MvEVAL EXPR="{SM_mail_error}"> </MvIF> </MvCALL> <MvELSE> <MvEVAL EXPR="{SM_user_header('Form Error')}"> <Center><H1><font color="#FF0000">Form Error</font></H1></Center> One or more of the fields that you entered into the form was not correct. Here is a summary of the errors:<P><blockquote> <MvEVAL EXPR="{SM_mail_error}"></blockquote> Please use your browser's [Back] button to return to the form and correct any errors.<BR> <MvEVAL EXPR="{SM_user_footer()}"> </MvIF> <MvCLOSE name="SM_form_att_db"> <MvCLOSE name="SM_form_db"> <MvExit> </MvFUNCTION SM_mail_input_error> <MvFUNCTION name="SM_admin_menu"> <MvIF EXPR="{ NOT SM_recheck_admin(SM_admin_name_good, SM_admin_password_good)}"> <MvEVAL EXPR="{SM_validate_admin_screen()}"> </MvIF> <MvIF EXPR="{NOT SM_no_admin_header}"> <MvEVAL EXPR="{SM_header('SimpleMail Administration Menu')}"> </MvIF> <H2>Main Menu</H2> <P>Welcome to SimpleMail administration. You may choose from the following:<BR> <MvEVAL EXPR="{SM_std_FORM()}"> <blockquote> <input type="radio" name="SM_action" value="SM_create_form_database_screen" checked> Create a new form database<BR> <MvIF EXPR="{fexists(SM_form_list_database)}"> <MvOPEN name="SM_form_list_db" database="{SM_form_list_database}"> </MvIF> <MvIF EXPR="{fexists(SM_form_list_database) AND SM_form_list_db.d.totrec GT 0}"> <input type="radio" name="SM_action" value="SM_modify_form_database_screen"> Modify an existing form database<BR> <input type="radio" name="SM_action" value="SM_delete_form_database_screen"> Delete an existing form database<BR> </MvIF> <input type="radio" name="SM_action" value="SM_delete_all_files_screen"> Delete your SimpleMail installation<BR> <input type="radio" name="SM_action" value="SM_create_admin_database_screen"> Change the administrator name and/or password</blockquote> <input type="submit" value="Go"> Or, you may choose to modify the database of one of the existing forms below by clicking on its link:</form> <MvIF EXPR="{fexists(SM_form_list_database) AND SM_form_list_db.d.totrec GT 0}"> <BR><blockquote> <MvWHILE EXPR="{ NOT SM_form_list_db.d.EOF }"> <MvASSIGN name="local.SM_filename_URL" value="{ glosub(SM_form_list_db.d.SM_frm_lst,'!','/')}"> <P><A HREF="&[SM_documenturl]?SM_action=SM_modify_form_database&SM_URL_filename=&[SM_form_list_db.d.SM_frm_lst]&SM_admin_name_good=&[SM_admin_name_good:entities]&SM_admin_password_good=&[SM_admin_password_good:entities]&SM_from_admin_menu=1"> <MvEVAL EXPR="{local.SM_filename_URL}"></a> <MvSKIP> </MvWHILE> </blockquote> This assignment would not be necessary except that Miva doesn't like tags within an IF <MvCLOSE name="SM_form_list_db"> </MvIF> <MvEVAL EXPR="{SM_footer()}"> <MvExit> </MvFUNCTION SM_admin_menu> <MvFUNCTION name="SM_recheck_admin" parameters="SM_name_in,SM_pass_in"> <MvLOCKFILE file="{SM_admin_database}"> <MvOPEN name="SM_admin_db" database="{SM_admin_database}"> <MvComment> </MvLOCKFILE> </MvComment> <MvASSIGN name="local.SM_name_db" value="{SM_admin_db.d.SM_name}"> <MvASSIGN name="local.SM_pass_db" value="{SM_admin_db.d.SM_pass}"> <MvCLOSE name="SM_admin_db"> </MvLOCKFILE> <MvIF EXPR="{ (toupper(local.SM_name_in) NE toupper(local.SM_name_db)) OR (local.SM_pass_in NE local.SM_pass_db)}"> <MvEVAL EXPR="{SM_validate_admin_screen()}"> </MvIF> <MvFUNCRETURN value="1"> </MvFUNCTION SM_recheck_admin> <MvFUNCTION name="SM_validate_admin"> <MvLOCKFILE file="{SM_admin_database}"> <MvOPEN name="SM_admin_db" database="{SM_admin_database}"> <MvASSIGN name="local.SM_name_db" value="{SM_admin_db.d.SM_name}"> <MvASSIGN name="local.SM_pass_db" value="{SM_admin_db.d.SM_pass}"> <MvCLOSE name="SM_admin_db"> </MvLOCKFILE> <MvIF EXPR="{toupper(SM_admin_name) NE toupper(local.SM_name_db)}"> <MvASSIGN name="SM_validate_admin_error" value="name"> <MvELSE> <MvASSIGN name="SM_admin_name_good" value="{SM_admin_name}"> </MvIF> <MvIF EXPR="{SM_admin_password NE local.SM_pass_db}"> <MvASSIGN name="SM_validate_admin_error" value="{SM_validate_admin_error $ 'pass'}"> <MvELSE> <MvASSIGN name="SM_admin_password_good" value="{SM_admin_password}"> </MvIF> <MvIF EXPR="{ NOT SM_validate_admin_error }"> <MvEVAL EXPR="{SM_admin_menu()}"> <MvELSE> <MvEVAL EXPR="{SM_validate_admin_screen()}"> </MvIF> </MvFUNCTION SM_validate_admin> <MvFUNCTION name="SM_validate_admin_screen"> <MvEVAL EXPR="{SM_header('SimpleMail Administrator Validation')}"> <Center><H3>Welcome. Please enter your username and password.</H3></Center> <FORM method="POST" action="&[SM_documenturl]"> <input type="hidden" name="SM_action" value="SM_validate_admin"> <table border="0" align="center"> <MvIF EXPR="{'name' CIN SM_validate_admin_error}"> <tr><td></td> <td><font color="#FF0000"><B>The username you entered was not correct</B></font></td></tr> </MvIF> <tr><th align="left">Username:</th> <td><input type="text" name="SM_admin_name" value="&[SM_admin_name_good]" size="50" maxlength="50"></td></tr> <MvIF EXPR="{'pass' CIN SM_validate_admin_error}"> <tr><td></td> <td><font color="#FF0000"><B>The password you entered was not correct</B></font></td></tr> </MvIF> <tr><th align="left">Password:</th> <td><input type="password" name="SM_admin_password" value="&[SM_admin_password_good]" size="50" maxlength="50"></td></tr> <tr><td></td> <td align=left><input type="submit" value="Validate me"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="reset"></td></tr></table></form> <MvEVAL EXPR="{SM_footer()}"> <MvExit> </MvFUNCTION SM_validate_admin_screen> <MvFUNCTION name="SM_go_admin_menu"> <MvEVAL EXPR="{SM_std_FORM()}"> <input type="hidden" name="SM_action" value="SM_admin_menu"> <input type="submit" value="Go to the main administration menu"></form> <MvEVAL EXPR="{SM_footer()}"> </MvFUNCTION SM_go_admin_menu> <MvFUNCTION name="SM_del_mod_display_list"> <MvIF EXPR="{ NOT SM_recheck_admin(SM_admin_name_good, SM_admin_password_good)}"> <MvEVAL EXPR="{SM_validate_admin_screen()}"> </MvIF> <MvLOCKFILE file="{SM_form_list_database}"> <MvOPEN name="SM_form_list_db" database="{SM_form_list_database}"> <MvWHILE EXPR="{ NOT SM_form_list_db.d.EOF }"> <MvASSIGN name="local.SM_filename_URL" value="{ glosub(SM_form_list_db.d.SM_frm_lst,'!','/')}"> <MvIF EXPR="{recno GT '1'}"> <input type="radio" name="SM_URL_filename" value="&[SM_form_list_db.d.SM_frm_lst]"> <MvEVAL EXPR="{local.SM_filename_URL}"><BR> <MvELSE> <input type="radio" name="SM_URL_filename" value="&[SM_form_list_db.d.SM_frm_lst]" checked> <MvEVAL EXPR="{local.SM_filename_URL}"><BR> </MvIF> <MvSKIP> </MvWHILE> <MvCLOSE name="SM_form_list_db"> </MvLOCKFILE> </MvFUNCTION SM_del_mod_display_list> <MvFUNCTION name="SM_delete_form_database_screen"> <MvIF EXPR="{ NOT SM_recheck_admin(SM_admin_name_good, SM_admin_password_good)}"> <MvEVAL EXPR="{SM_validate_admin_screen()}"> </MvIF> <MvEVAL EXPR="{SM_header( 'SimpleMail Form Database Deletion' )}"> <H2>Choose a form database for deletion:</H2> <MvEVAL EXPR="{SM_std_FORM()}"> <input type="hidden" name="SM_action" value="SM_delete_form_database"> <input type="hidden" name="SM_goto_admin_menu" value="1"> <MvEVAL EXPR="{SM_del_mod_display_list()}"> <BR><input type="submit" value="Delete this database"></form> <MvEVAL EXPR="{SM_footer()}"> <MvExit> </MvFUNCTION SM_delete_form_database_screen> <MvFUNCTION name="SM_modify_form_database_screen"> <MvIF EXPR="{ NOT SM_recheck_admin(SM_admin_name_good, SM_admin_password_good)}"> <MvEVAL EXPR="{SM_validate_admin_screen()}"> </MvIF> <MvEVAL EXPR="{SM_header('SimpleMail Form Database Modification')}"> <H2>Choose a form database for modification:</H2> <MvEVAL EXPR="{SM_std_FORM()}"> <input type="hidden" name="SM_action" value="SM_modify_form_database"> <input type="hidden" name="SM_from_admin_menu" value="1"> <MvEVAL EXPR="{SM_del_mod_display_list()}"> <BR><input type="submit" value="Modify this database"> Give the user a custom message depending on how we got here.</form> <MvEVAL EXPR="{SM_footer()}"> <MvExit> </MvFUNCTION SM_modify_form_database_screen> <MvFUNCTION name="SM_make_short_URL" parameters="SM_long_URL"> <MvASSIGN name="local.SM_has_cgi" value="{'cgi-bin' CIN local.SM_long_URL }"> <MvIF EXPR="{ NOT local.SM_has_cgi }"> <MvFUNCRETURN value="{substring(local.SM_long_URL,1, (len(local.SM_long_URL) - len(path_info))) $ '/'}"> <MvELSE> <MvFUNCRETURN value="{substring(local.SM_long_URL,1,(local.SM_has_cgi - 1))}"> </MvIF> </MvFUNCTION SM_make_short_URL> <MvFUNCTION name="SM_modify_form_database"> <MvIF EXPR="{ NOT SM_recheck_admin(SM_admin_name_good, SM_admin_password_good)}"> <MvEVAL EXPR="{SM_validate_admin_screen()}"> </MvIF> <MvEVAL EXPR="{SM_header('SimpleMail Form Database Modification')}"> <MvComment> </MvComment> <MvIF EXPR="{SM_form_update_error}"> <H2><font color="#FF0000">Error:</font></H2> There was an error in one or more of the fields you entered, so your form database has not yet been updated. Please take a look at the fields below, correct any errors, re-enter your other changes and resubmit this form. <I>your form database has <B>not</B> yet been updated</I> <P><HR size="5" width="90%"> </MvIF> <MvIF EXPR="{SM_not_really_new}"> <H2>Form Database Creation</H2> Caution: You asked to create a new database for the form listed below, however a database for that form already exists. Never fear though, you can make your changes here and the database for this form will be updated with your new values. <font color="#FF0000">Caution:</font> <P><HR size="5" width="90%"> </MvIF> <MvIF EXPR="{SM_I_am_a_new_form}"> <H2>Form Database Creation</H2> The form database for the URL listed below has been created successfully. </MvIF> <MvIF EXPR="{SM_from_admin_menu}"> <H2>Form Database Modification</H2> The information below comes from the database for the HTML mail form listed. If you would like to make any changes to your formatting or other form attributes you can do so on this form and push the &quot;Save&quot; button at the bottom of this form. If you make any changes to your form database here, make sure that all of your information is correct because the database will be recreated with the values shown here. </MvIF> <MvLOCKFILE file="{SM_files $ SM_URL_filename $ '.dbf' }"> <MvOPEN name="SM_form_db" database="{SM_files $ SM_URL_filename $ '.dbf' }"> <MvEVAL EXPR="{SM_std_FORM()}"> <input type="hidden" name="SM_action" value="SM_update_form_database"> <input type="hidden" name="SM_form_URL_input" value="&[SM_form_db.d.SM_URL]"> <input type="hidden" name="SM_URL_filename" value="&[SM_URL_filename]"> <input type="hidden" name="SM_from_admin_menu" value="&[SM_from_admin_menu]"> <B><I>any</I></B> <B><I>all</I></B> <P>If you are happy with the attributes of the form as listed, you can push the &quot;Go to the main administration menu&quot; button at the bottom of the form and no changes will be made. <P>If you change the name of a variable in your form, you <I>must</I> recreate the database for that form. <H3>URL of your form:<BR> <A HREF="&[SM_form_db.d.SM_URL];" target="&[SM_form_db.d.SM_URL];"> <MvEVAL EXPR="{SM_form_db.d.SM_URL}"></a></H3> Destination e-mail address: <B>Destination e-mail address:</B> <MvIF EXPR="{SM_form_update_error}"> <MvIF EXPR="{SM_form_email_update_error}"> <font color="#FF0000"> <MvEVAL EXPR="{SM_form_email_update_error}"></font> </MvIF> </MvIF> <BR><input type="text" name="SM_form_email_update" value="&[SM_form_db.d.SM_email]" size="50" maxlength="150"> <MvASSIGN name="local.SM_short_url" value="{SM_make_short_URL(SM_documenturl)}"> <I><H3><font color="#009900">Optional fields:</font></H3></i> When your user completes your form and an e-mail to you is generated by SimpleMail they are sent by default to a one line page with the words, "Your form has been processed successfully. Thank you." If you would like to send them to a page of your own instead, specify it here. <P><I>If you plan to use a customized response page make sure that you specify the <B>complete</B> URL, including <MvEVAL EXPR="{local.SM_short_URL}"></I> <P><B>Response URL:</B> <MvIF EXPR="{SM_form_update_error}"> <MvIF EXPR="{SM_form_resp_URL_update_error}"> <font color="#FF0000"> <MvEVAL EXPR="{SM_form_resp_URL_update_error}"></font> </MvIF> </MvIF> <BR><input type="text" name="SM_form_resp_URL_update" value="&[SM_form_db.d.SM_resp]" size="75" maxlength="250"> <P>By default SimpleMail will use a META &quot;refresh&quot; tag to send users to your response page if you include one. Very old browsers do not know how to process that tag, so they will see the standard SimpleMail response page instead of your custom one. If you would rather not use the &quot;refresh&quot; tag, check this box. <P><table BORDER align="center"> <tr><th align="left">Do not use META &quot;refresh&quot; to show my custom response page</th><td> <MvIF EXPR="{SM_form_db.d.SM_no_meta}"> <input type="checkbox" name="SM_form_no_meta_update" value="1" checked> <MvELSE> <input type="checkbox" name="SM_form_no_meta_update" value="1"> </MvIF> </td></tr></TABLE> <P>If you would like to specify a URL for an error reply to your users, enter it here. If there is no page specified, the default error form will be used as described in the <A HREF="&[documenturl]SM_action=SM_form_help" target="help"> form creation help file</a>. <P><I>If you plan to use a customized error page make sure that you specify the <B>complete</B> URL, including <MvEVAL EXPR="{local.SM_short_URL}"></I> <P><B>Error URL:</B> <MvIF EXPR="{SM_form_update_error}"> <MvIF EXPR="{SM_form_error_URL_update_error}"> <font color="#FF0000"> <MvEVAL EXPR="{SM_form_error_URL_update_error}"></font> </MvIF> </MvIF> <BR><input type="text" name="SM_form_error_URL_update" value="&[SM_form_db.d.SM_error]" size="75" maxlength="250"> <P>SimpleMail can customize the value of the From: e-mail address and Subject: line in the e-mail that you receive after users POST mail from your form. Either or both lines can be plain text that you specify here, variables that you use in your form, or in the Subject: a combination of both. If you would like to use a plain text string, you can enter it directly into this form below. You can use the value of a variable from your form by putting an ampersand (&amp;) before the variable name. For example if you want the From: e-mail address to be the variable called &quot;users_email&quot; from your form, you would put this in the form below: <P>&amp;users_email <P>Please be aware that the From: e-mail field can only have ONE e-mail address, and no additional plain text. If you use a variable from your form make sure to add the &quot;E-mail&quot; and &quot;Mandatory&quot; attributes to that variable in the attributes section below. Otherwise Miva will not send mail from your form. <P>The From: and Subject: lines must be filled in with something in order for Miva to send your mail. If you are not concerned with what appears in those fields on the e-mail you receive the following default text will be filled in for you. <MvIF EXPR="{SM_form_db.d.SM_from }"> <MvASSIGN name="local.SM_from_default" value="{SM_form_db.d.SM_from}"> <MvELSE> <MvASSIGN name="local.SM_from_default" value="{ gettoken(SM_form_db.d.SM_email,asciichar(44),1) }"> </MvIF> <P><B>E-mail &quot;From:&quot; address:</B> <MvIF EXPR="{SM_form_update_error}"> <MvIF EXPR="{SM_form_from_update_error}"> <font color="#FF0000"> <MvEVAL EXPR="{SM_form_from_update_error}"></font> </MvIF> </MvIF> <BR><input type="text" name="SM_form_from_update" value="&[local.SM_from_default:entities]" size="50" maxlength="50"> <MvIF EXPR="{SM_form_db.d.SM_subject }"> <MvASSIGN name="local.SM_subject_default" value="{SM_form_db.d.SM_subject }"> <MvELSE> <MvASSIGN name="local.SM_subject_default" value="{ 'SimpleMail from ' $ SM_form_db.d.SM_URL }"> </MvIF> <P><B>E-mail &quot;Subject:&quot; line:</B> <BR><input type="text" name="SM_form_subject_update" value="&[local.SM_subject_default:entities]" size="75" maxlength="250"> <P>In addition to sending e-mail to the account you specify SimpleMail can save a copy of each mail it sends to a file. The files for this form will be saved in the <TT><MvEVAL EXPR="{SM_files $ SM_URL_filename $ '-files'}"></TT> directory, which will be within the <TT>mivadata</TT> directory in your account. <P><table BORDER align="center"> <tr><th align="left">Save mail to a file:</th><td> <MvIF EXPR="{SM_form_db.d.SM_filedir}"> <input type="checkbox" name="SM_form_file_update" value="1" checked> <MvELSE> <input type="checkbox" name="SM_form_file_update" value="1"> </MvIF> </td></tr></TABLE> <I><H3><font color="#009900">Attributes:</font></H3></i> <MvLOCKFILE file="{SM_files $ SM_URL_filename $ '-att.dbf' }"> <MvOPEN name="SM_form_att_db" database="{SM_files $ SM_URL_filename $ '-att.dbf' }"> <P>The individual variables from your form can have the following attributes. Is the variable <I>Mandatory</I>? Is the variable a <I>Numeric</I> field? Is it an <I>E-mail address</I>? And does that field contain an <I>IP address</I>? Specifying that a variable is both an e-mail address and a number would not be very useful. :) <P>If a user of your form enters information which does not match the attributes for that field specified here SimpleMail will send that user an error indicating what information needs to be changed, either through the default error form or through a form that you specify above. <P><table BORDER align="center"><tr><th align="left">Form variable</th> <th>Mandatory</th><th>Numeric</th><th>E-Mail</th><th>IP</th></tr> <MvWHILE EXPR="{ NOT SM_form_att_db.d.EOF }"> <tr><td align="left"><MvEVAL EXPR="{SM_form_att_db.d.SM_name}"></td> <MvIF EXPR="{SM_form_att_db.d.SM_mand}"> <td align="center"><input type="checkbox" name="SM_form_mod_&[SM_form_att_db.d.SM_name]_mand" value="1" checked></td> <MvELSE> <td align="center"><input type="checkbox" name="SM_form_mod_&[SM_form_att_db.d.SM_name]_mand" value="1"></td> </MvIF> <MvIF EXPR="{SM_form_att_db.d.SM_digit}"> <td align="center"><input type="checkbox" name="SM_form_mod_&[SM_form_att_db.d.SM_name]_digit" value="1" checked></td> <MvELSE> <td align="center"><input type="checkbox" name="SM_form_mod_&[SM_form_att_db.d.SM_name]_digit" value="1"></td> </MvIF> <MvIF EXPR="{SM_form_att_db.d.SM_email}"> <td align="center"><input type="checkbox" name="SM_form_mod_&[SM_form_att_db.d.SM_name]_email" value="1" checked></td> <MvELSE> <td align="center"><input type="checkbox" name="SM_form_mod_&[SM_form_att_db.d.SM_name]_email" value="1"></td> </MvIF> <MvIF EXPR="{SM_form_att_db.d.SM_IP}"> <td align="center"><input type="checkbox" name="SM_form_mod_&[SM_form_att_db.d.SM_name]_IP" value="1" checked></td> <MvELSE> <td align="center"><input type="checkbox" name="SM_form_mod_&[SM_form_att_db.d.SM_name]_IP" value="1"></td> </MvIF> </tr> <MvSKIP name="SM_form_att_db"> </MvWHILE> </table> <MvCLOSE name="SM_form_att_db"> </MvLOCKFILE> <P>Below is the existing format for the e-mail that will be sent when the form at <B><MvEVAL EXPR="{SM_form_URL_input }"></B> is POST'ed to SimpleMail. You can modify this formatting two ways. First, by adding plain text that you want to see in the e-mail you receive at any point in the editing window below. Second, wherever you want the value of a variable name from your form displayed, add an ampersand (&amp;) to the front of the variable: <P>&amp;your_variable_name <P>SimpleMail will convert that to the value of the variable with that name. For instance, if your variable had the name &quot;product_line,&quot; which contains the name of -- you guessed it -- one of your product lines, you would use a line like this: <P>Product line: &product_line <P>This will display the following text in the e-mail you receive if the user filling out your form enters &quot;Long handled brushes&quot; as the product line he or she is interested in: <P>Product line: Long handled brushes <P><font color="#FF0000">Caution:</font> Miva uses an XML (e<B>X</B>tensible <B>M</B>arkup <B>L</B>anguage) script interpreter that works like HTML. Therefore you must make sure that any plain text you enter does not contain the HTML formatting characters &lt;, &gt;, &amp;, or &quot;. You should also use caution with characters like ( ), and { } because Miva uses them internally. <P><B>Edit your formatting here:</b> <textarea name="SM_form_new_format" rows="20" cols="76" wrap="hard"> <MvEVAL EXPR="{SM_form_db.d.SM_format}"></textarea> <P><input type="submit" value="Save these changes"> <input type="reset" value="Reset this form to the default values"></form> <MvCLOSE name="SM_form_db"> </MvLOCKFILE> <MvEVAL EXPR="{SM_go_admin_menu()}"> <MvExit> </MvFUNCTION SM_modify_form_database> <MvFUNCTION name="SM_delete_form_database"> <MvIF EXPR="{ NOT SM_recheck_admin(SM_admin_name_good, SM_admin_password_good)}"> <MvEVAL EXPR="{SM_validate_admin_screen()}"> </MvIF> <MvIF EXPR="{fexists(SM_files $ SM_URL_filename $ '.dbf')}"> <MvIF EXPR="{ NOT fdelete(SM_files $ SM_URL_filename $ '.dbf')}"> <MvASSIGN name="SM_delete_files_error" value="{ SM_delete_files_error $ SM_files $ SM_URL_filename $ '.dbf<BR>' }"> </MvIF> </MvIF> <MvIF EXPR="{fexists(SM_files $ SM_URL_filename $ '.dbt')}"> <MvIF EXPR="{ NOT fdelete(SM_files $ SM_URL_filename $ '.dbt')}"> <MvASSIGN name="SM_delete_files_error" value="{ SM_delete_files_error $ SM_files $ SM_URL_filename $ '.dbt<BR>' }"> </MvIF> </MvIF> <MvIF EXPR="{fexists(SM_files $ SM_URL_filename $ '-att.dbf')}"> <MvIF EXPR="{ NOT fdelete(SM_files $ SM_URL_filename $ '-att.dbf')}"> <MvASSIGN name="SM_delete_files_error" value="{ SM_delete_files_error $ SM_files $ SM_URL_filename $ '-att.dbf<BR>' }"> </MvIF> </MvIF> <MvIF EXPR="{ NOT SM_delete_files_error }"> <MvEVAL EXPR="{SM_header('SimpleMail Administration Menu')}"> <tiny>Old database deleted successfully</tiny><BR> <MvELSE> <MvEVAL EXPR="{SM_header('SimpleMail Error')}"> <H2><font color="#FF0000">Error:</font></H2> There was an error deleting the form databases for the form at . You should take a look at the directory under your mivadata directory in your account and delete: <MvEVAL EXPR="{ glosub(SM_URL_filename,'!','/')}"> <TT><MvEVAL EXPR="{SM_dir}"></TT> <TT>mivadata</TT> <P><blockquote><MvEVAL EXPR="{SM_delete_files_error}"></blockquote> Then you should be able to resume the operation you were attempting when this error occured. <P>If you need assistance please feel free to contact Customer Support. <MvEVAL EXPR="{SM_footer()}"> <MvExit> </MvIF> <MvLOCKFILE file="{SM_form_list_database}"> <MvOPEN name="SM_form_list_db" database="{SM_form_list_database}"> <MvWHILE EXPR="{ NOT SM_form_list_db.d.EOF }"> <MvIF EXPR="{ toupper(SM_form_list_db.d.SM_frm_lst) EQ toupper(SM_URL_filename) }"> <MvDELETE name="SM_form_list_db"> </MvIF> <MvSKIP name="SM_form_list_db"> </MvWHILE> <MvPACK name="SM_form_list_db"> <MvCLOSE name="SM_form_list_db"> </MvLOCKFILE> <tiny>List of databases updated successfully</tiny><BR> <MvIF EXPR="{SM_goto_admin_menu}"> <MvASSIGN name="SM_no_admin_header" value="1"> <MvEVAL EXPR="{SM_admin_menu()}"> </MvIF> </MvFUNCTION SM_delete_form_database> <MvFUNCTION name="SM_IsValid" parameters="SM_IsValid_input"> <MvASSIGN name="local.SM_length" value="{len(local.SM_IsValid_input)}"> <MvASSIGN name="local.SM_curr_pos" value="1"> <MvWHILE EXPR="{ local.SM_curr_pos LE local.SM_length }"> <MvIF EXPR="{ substring(local.SM_IsValid_input,local.SM_curr_pos,1) CIN 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_' }"> <MvASSIGN name="local.SM_curr_pos" value="{local.SM_curr_pos + 1}"> <MvELSE> <MvFUNCRETURN value="0"> </MvIF> </MvWHILE> <MvFUNCRETURN value="1"> </MvFUNCTION SM_IsValid"> <MvFUNCTION name="SM_update_form_database"> <MvIF EXPR="{ NOT SM_recheck_admin(SM_admin_name_good, SM_admin_password_good)}"> <MvEVAL EXPR="{SM_validate_admin_screen()}"> </MvIF> <MvComment> Check the destination e-mail address</MvComment> <MvIF EXPR="{SM_form_email_update}"> <MvASSIGN name="SM_update_form_database_email" value="{SM_clean_email_address(SM_form_email_update)}"> <MvIF EXPR="{substring(SM_update_form_database_email,'1','5') EQ 'Error'}"> <MvASSIGN name="SM_form_email_update_error" value="{SM_update_form_database_email }"> </MvIF> <MvELSE> <MvASSIGN name="SM_form_email_update_error" value="The e-mail field is mandatory."> </MvIF> <MvComment> Check the optional response page URL</MvComment> <MvIF EXPR="{SM_form_resp_URL_update}"> <MvIF EXPR="{ 'http://' CIN SM_form_resp_URL_update EQ '1' }"> <MvCALL action="{SM_form_resp_URL_update}" method="GET"> <MvIF EXPR="{ ((callobjecttype CIN 'tag') AND (callobjectelement CIN 'body'))}"> <MvCALLSTOP> </MvIF> <MvIF EXPR="{ callobjecttype CIN 'text' }"> <MvIF EXPR="{ substring(callvalue,'1','3') EQ '404' }"> <MvASSIGN name="SM_form_resp_URL_update_error" value="404: The requested URL was not found"> <MvCALLSTOP> </MvIF> </MvIF> </MvCALL> <MvELSE> <MvASSIGN name="SM_form_resp_URL_update_error" value="404: The requested URL was not found"> </MvIF> </MvIF> <MvComment> Check the optional error page URL</MvComment> <MvIF EXPR="{SM_form_error_URL_update}"> <MvASSIGN name="SM_form_error_URL_update_error" value="<BR>You neglected to add the pseudo-tag to your error page, so the error messages could not be displayed. <BR>Please see the <A HREF=\"&[documenturl]SM_action=SM_form_help\" target=\"help\"> form creation help file for details."> <MvIF EXPR="{ 'http://' CIN SM_form_error_URL_update EQ '1' }"> <MvCALL action="{SM_form_error_URL_update}" method="GET"> <MvIF EXPR="{ callobjecttype CIN 'text' }"> <MvIF EXPR="{ substring(callvalue,'1','3') EQ '404' }"> <MvASSIGN name="SM_form_error_URL_update_error" value="404: The requested URL was not found"> <MvCALLSTOP> <MvELSE> <MvIF EXPR="{ '##List of errors here##' CIN callvalue }"> <MvASSIGN name="SM_form_error_URL_update_error" value=""> <MvCALLSTOP> </MvIF> </MvIF> </MvIF> </MvCALL> <MvELSE> <MvASSIGN name="SM_form_error_URL_update_error" value="404: The requested URL was not found"> </MvIF> </MvIF> <MvComment> If the user put something in the From: e-mail address category, check to see if it's a variable or if it's a plain text e-mail address. If it's plain text, check to make sure there is just one address, and that it's valid, then return with the formatted address to enter into the database. </MvComment> <MvIF EXPR="{SM_form_from_update }"> <MvIF EXPR="{ '&' IN SM_form_from_update EQ '1' }"> <MvASSIGN name="SM_form_from_checkit" value="{ substring(SM_form_from_update,2,160)}"> <MvELSE> <MvASSIGN name="SM_update_form_database_email_from" value="{SM_clean_email_address(SM_form_from_update)}"> <MvIF EXPR="{substring(SM_update_form_database_email_from,'1','5') EQ 'Error'}"> <MvASSIGN name="SM_form_from_update_error" value="{SM_update_form_database_email_from}"> </MvIF> <MvELSE> <MvASSIGN name="SM_update_form_database_email_from" value="{ gettoken(SM_form_db.d.SM_email,asciichar(44),1) }"> </MvIF> </MvIF> <MvComment> If we found an error above, make a note so that we can send them back to the input screen after saving the valid responses. </MvComment> <MvIF EXPR="{ (SM_form_email_update_error) OR (SM_form_resp_URL_update_error) OR (SM_form_error_URL_update_error) OR (SM_form_from_update_error)}"> <MvASSIGN name="SM_form_update_error" value="1"> </MvIF> <MvComment> Start the process of creating new databases with the new info. First the main form db then the attribute db. </MvComment> <MvOPEN name="SM_update_form_db" database="{SM_files $ SM_URL_filename $ '.dbf'}"> <MvCOMMENT> Save this value before we wipe the old db.</MvCOMMENT> <MvASSIGN name="local.SM_filenumber" value="{SM_update_form_db.d.SM_filenum}"> <MvCLOSE name="SM_update_form_db"> <MvCREATE name="SM_update_form_db" database="{SM_files $ SM_URL_filename $ '.dbf'}" fields=" SM_URL CHAR(250), SM_email CHAR(200), SM_resp CHAR(250), SM_error CHAR(250), SM_from CHAR(100), SM_subject CHAR(250), SM_filedir BOOL, SM_filenum NUMBER, SM_no_meta BOOL, SM_format MEMO"> <MvComment> This value is always good </MvComment> <MvASSIGN name="SM_update_form_db.d.SM_URL" value="{SM_form_URL_input}"> <MvComment> For the rest, if there is no error, save the value. If there is an error, we will give them another chance below. </MvComment> <MvIF EXPR="{ NOT SM_form_email_update_error }"> <MvASSIGN name="SM_update_form_db.d.SM_email" value="{SM_update_form_database_email}"> </MvIF> <MvIF EXPR="{ NOT SM_form_resp_URL_update_error }"> <MvASSIGN name="SM_update_form_db.d.SM_resp" value="{SM_form_resp_URL_update}"> </MvIF> <MvIF EXPR="{ NOT SM_form_error_URL_update_error }"> <MvASSIGN name="SM_update_form_db.d.SM_error" value="{SM_form_error_URL_update}"> </MvIF> <MvIF EXPR="{ (NOT SM_form_from_checkit) AND (NOT SM_form_from_update_error) }"> <MvASSIGN name="SM_update_form_db.d.SM_from" value="{SM_update_form_database_email_from}"> </MvIF> <MvASSIGN name="SM_update_form_db.d.SM_subject" value="{SM_form_subject_update}"> <MvASSIGN name="SM_update_form_db.d.SM_filedir" value="{SM_form_file_update}"> <MvIF EXPR="{SM_update_form_db.d.SM_filedir AND (NOT fexists(SM_files $ SM_URL_filename $ '-files'))}"> <MvASSIGN name="local.return_value" value="{fmkdir(SM_files $ SM_URL_filename $ '-files')}"> </MvIF> <MvIF EXPR="{local.SM_filenumber GT 1}"> <MvASSIGN name="SM_update_form_db.d.SM_filenum" value="{local.SM_filenumber}"> <MvELSE> <MvASSIGN name="SM_update_form_db.d.SM_filenum" value="1"> </MvIF> <MvASSIGN name="SM_update_form_db.d.SM_no_meta" value="{SM_form_no_meta_update}"> <MvASSIGN name="SM_update_form_db.d.SM_format" value="{SM_form_new_format}"> <MvComment> Read in their form, creating the attributes database with the new values. By using MvCreate it will delete the old one. </MvComment> <MvCREATE name="SM_update_form_att_db" database="{SM_files $ SM_URL_filename $ '-att.dbf'}" fields=" SM_name CHAR(250), SM_mand BOOL, SM_digit BOOL, SM_email BOOL, SM_IP BOOL"> <MvCALL action="{SM_form_URL_input}" method="GET"> <MvIF EXPR="{ ((callobjecttype CIN 'tag') AND ((tolower(callobjectelement) EQ 'input') OR (tolower(callobjectelement) EQ 'textarea') OR (tolower(callobjectelement) EQ 'select'))) }"> <MvASSIGN name="local.counter" value="1"> <MvWHILE EXPR="{local.counter LE callobjectnumattributes}"> <MvIF EXPR="{ tolower(callobjectattribute&[local.counter]) EQ 'name'}"> <MvASSIGN name="SM_update_form_att_db.d.SM_name" value="{ callobjectvalue&[local.counter] }"> <MvIF EXPR="{SM_form_from_checkit}"> <MvIF EXPR="{ tolower( callobjectvalue&[local.counter] ) EQ tolower(SM_form_from_checkit)}"> <MvASSIGN name="SM_update_form_db.d.SM_from" value="{'&' $ SM_form_from_checkit}"> <MvASSIGN name="SM_form_from_checkit" value=""> </MvIF> </MvIF> <MvComment> Assign temp variables to the attribute + name pair because Miva won't doubly de-reference variables. </MvComment> <MvASSIGN name="local.SM_test_mand" value="{ 'SM_form_mod_' $ callobjectvalue&[local.counter] $ '_mand' }"> <MvASSIGN name="local.SM_test_digit" value="{ 'SM_form_mod_' $ callobjectvalue&[local.counter] $ '_digit' }"> <MvASSIGN name="local.SM_test_email" value="{ 'SM_form_mod_' $ callobjectvalue&[local.counter] $ '_email' }"> <MvASSIGN name="local.SM_test_IP" value="{ 'SM_form_mod_' $ callobjectvalue&[local.counter] $ '_IP' }"> <MvComment> Just assign the value. It will either be "1" because that's the value from the form above, or "NULL" which != 1 so the boolean value of this field will still be valid. </MvComment> <MvASSIGN name="SM_update_form_att_db.d.SM_mand" value="{ &[local.SM_test_mand] }"> <MvASSIGN name="SM_update_form_att_db.d.SM_digit" value="{ &[local.SM_test_digit] }"> <MvASSIGN name="SM_update_form_att_db.d.SM_email" value="{ &[local.SM_test_email] }"> <MvASSIGN name="SM_update_form_att_db.d.SM_IP" value="{ &[local.SM_test_IP] }"> <MvADD name="SM_update_form_att_db"> </MvIF> <MvASSIGN name="local.counter" value="{local.counter + 1}"> </MvWHILE> </MvIF> </MvCALL> <MvCLOSE name="SM_update_form_att_db"> <MvIF EXPR="{MvCLOSE_Error}"> <MvASSIGN name="local.SM_create_db_error" value="{MvCLOSE_Error $ '<BR>'}"> </MvIF> <MvComment> If this value still exists it means there was an error. Set the default value again for safety or else they won't be able to send mail. </MvComment> <MvIF EXPR="{SM_form_from_checkit}"> <MvASSIGN name="SM_form_from_update_error" value="The variable you entered does not exist in your form"> <MvASSIGN name="SM_form_update_error" value="1"> <MvASSIGN name="SM_update_form_db.d.SM_from" value="{ gettoken(SM_update_form_database_email,asciichar(44),1) }"> </MvIF> <MvADD name="SM_update_form_db"> <MvIF EXPR="{MvAdd_Error}"> <MvASSIGN name="local.SM_create_db_error" value="{ local.SM_create_db_error $ MvADD_Error $ '<BR>'}"> </MvIF> <MvCLOSE name="SM_update_form_db"> <MvIF EXPR="{MvCLOSE_Error}"> <MvASSIGN name="local.SM_create_db_error" value="{ local.SM_create_db_error $ MvCLOSE_Error $ '<BR>'}"> </MvIF> <MvComment> Now that the new databases for this form have been created, add the encoded name of the form to the "list of forms" database so we can use it later. </MvComment> <MvIF EXPR="{ NOT fexists(SM_form_list_database)}"> <MvCREATE name="SM_form_list_db" database="{SM_form_list_database}" fields="SM_frm_lst CHAR(250)"> <MvELSE> <MvOPEN name="SM_form_list_db" database="{SM_form_list_database}"> </MvIF> <MvComment>Delete any occurrence of the form that's already there</MvComment> <MvWHILE EXPR="{ NOT SM_form_list_db.d.EOF }"> <MvIF EXPR="{ toupper(SM_form_list_db.d.SM_frm_lst) EQ toupper(SM_URL_filename) }"> <MvDELETE name="SM_form_list_db"> </MvIF> <MvSKIP name="SM_form_list_db"> </MvWHILE> <MvPACK name="SM_form_list_db"> <MvASSIGN name="SM_form_list_db.d.SM_frm_lst" value="{SM_URL_filename}"> <MvADD name="SM_form_list_db"> <MvIF EXPR="{MvAdd_Error}"> <MvASSIGN name="local.SM_create_db_error" value="{ local.SM_create_db_error $ MvADD_Error $ '<BR>'}"> </MvIF> <MvCLOSE name="SM_form_list_db"> <MvIF EXPR="{MvCLOSE_Error}"> <MvASSIGN name="local.SM_create_db_error" value="{ local.SM_create_db_error $ MvCLOSE_Error $ '<BR>'}"> </MvIF> <MvComment> If there was an error creating the databases, let the user know </MvComment> <MvIF EXPR="{local.SM_create_db_error}"> <MvEVAL EXPR="{SM_header('SimpleMail Database Creation Failure')}"> <H2><font color="#FF0000">Error:</font></H2> Unfortunately, there was an error in the process of creating your mail form databases. The following errors were generated: <P><MvEVAL EXPR="{local.SM_create_db_error}"> <P>If you need assistance please feel free to contact Customer Support. <MvEVAL EXPR="{SM_footer()}"> <MvExit> </MvIF> <MvComment> Since this isn't a fatal error (just an annoyance) let everything else get updated (because it was deleted previously) but let the user know there was an error so they can fix it if desired. </MvComment> <MvComment> As advertised, send them back to correct the error if one exists. </MvComment> <MvIF EXPR="{SM_form_update_error}"> <MvEVAL EXPR="{SM_modify_form_database()}"> </MvIF> <MvComment> Otherwise, it's all good so back to the main admin menu </MvComment> <MvEVAL EXPR="{SM_header('SimpleMail Administration Menu')}"> Form database updated successfully<BR> <MvASSIGN name="SM_no_admin_header" value="1"> <MvEVAL EXPR="{SM_admin_menu()}"> </MvFUNCTION SM_update_form_database> <MvFUNCTION name="SM_create_form_database"> <MvIF EXPR="{ NOT SM_recheck_admin(SM_admin_name_good, SM_admin_password_good)}"> <MvEVAL EXPR="{SM_validate_admin_screen()}"> </MvIF> <MvComment> Start the process of creating the actual databases. First the main form db then the attribute db. </MvComment> <MvCREATE name="SM_new_form_db" database="{SM_files $ SM_URL_filename $ '.dbf'}" fields=" SM_URL CHAR(250), SM_email CHAR(200), SM_resp CHAR(250), SM_error CHAR(250), SM_from CHAR(100), SM_subject CHAR(250), SM_filedir BOOL, SM_filenum NUMBER, SM_no_meta BOOL, SM_format MEMO"> <MvASSIGN name="SM_new_form_db.d.SM_URL" value="{SM_form_URL_input}"> <MvASSIGN name="SM_new_form_db.d.SM_email" value="{SM_create_form_database_email}"> <MvASSIGN name="SM_new_form_db.d.SM_from" value="{ gettoken(SM_create_form_database_email,asciichar(44),1) }"> <MvASSIGN name="SM_new_form_db.d.SM_subject" value="{'SimpleMail from ' $ SM_form_URL_input}"> <MvCREATE name="SM_new_form_att_db" database="{SM_files $ SM_URL_filename $ '-att.dbf'}" fields=" SM_name CHAR(250), SM_mand BOOL, SM_digit BOOL, SM_email BOOL, SM_IP BOOL"> <MvComment> Read in their form, populate the formatting part of the database with basic defaults to get them started, and create the attributes database. </MvComment> <MvCALL action="{SM_new_form_db.d.SM_URL}" method="GET"> <MvIF EXPR="{ ((callobjecttype CIN 'tag') AND ((tolower(callobjectelement) EQ 'input') OR (tolower(callobjectelement) EQ 'textarea') OR (tolower(callobjectelement) EQ 'select'))) }"> <MvASSIGN name="local.counter" value="1"> <MvWHILE EXPR="{local.counter LE callobjectnumattributes}"> <MvIF EXPR="{ callobjectattribute&[local.counter] CIN 'name'}"> <MvIF EXPR="{ NOT SM_IsValid(callobjectvalue&[local.counter]) }"> <MvEVAL EXPR="{SM_header('Form Variable Name Error')}"> <H2><font color="#FF0000">Error:</font></H2> The variable named &quot;&quot; from your form contains an invalid character. The only valid characters for the names of form variables are A-Z, a-z, 0-9 and '_' (underscore). <B><MvEVAL EXPR="{callobjectvalue&[local.counter]}"></B> <P>Please change the name of this variable, and any others that have invalid characters and return to the form database creation process. <P>More help is available at the <A HREF="&[documenturl]SM_action=SM_form_help" target="help"> form creation help file.</a> <MvEVAL EXPR="{SM_footer()}"> <MvASSIGN name="local.return_value" value="{ fdelete(SM_files $ SM_URL_filename $ '.dbf')}"> <MvASSIGN name="local.return_value" value="{ fdelete(SM_files $ SM_URL_filename $ '.dbt')}"> <MvASSIGN name="local.return_value" value="{ fdelete(SM_files $ SM_URL_filename $ '-att.dbf')}"> <MvExit> </MvIF> <MvASSIGN name="SM_new_form_db.d.SM_format" value="{SM_new_form_db.d.SM_format $ callobjectvalue&[local.counter] $ '\: \&' $ callobjectvalue&[local.counter] $ SM_crlf }"> <MvASSIGN name="SM_new_form_att_db.d.SM_name" value="{ callobjectvalue&[local.counter] }"> <MvADD name="SM_new_form_att_db"> </MvIF> <MvASSIGN name="local.counter" value="{local.counter + 1}"> </MvWHILE> </MvIF> </MvCALL> <MvADD name="SM_new_form_db"> <MvIF EXPR="{MvAdd_Error}"> <MvASSIGN name="local.SM_create_db_error" value="{MvADD_Error $ '<BR>'}"> </MvIF> <MvComment> Now that the new databases for this form have been created, add the encoded name of the form to the "list of forms" database so we can use it later. </MvComment> <MvIF EXPR="{ NOT fexists(SM_form_list_database)}"> <MvCREATE name="SM_form_list_db" database="{SM_form_list_database}" fields="SM_frm_lst CHAR(250)"> <MvELSE> <MvOPEN name="SM_form_list_db" database="{SM_form_list_database}"> </MvIF> <MvComment>Delete any occurrence of the form that's already there</MvComment> <MvWHILE EXPR="{ NOT SM_form_list_db.d.EOF }"> <MvIF EXPR="{ toupper(SM_form_list_db.d.SM_frm_lst) EQ toupper(SM_URL_filename) }"> <MvDELETE name="SM_form_list_db"> </MvIF> <MvSKIP name="SM_form_list_db"> </MvWHILE> <MvPACK name="SM_form_list_db"> <MvASSIGN name="SM_form_list_db.d.SM_frm_lst" value="{SM_URL_filename}"> <MvADD name="SM_form_list_db"> <MvIF EXPR="{MvAdd_Error}"> <MvASSIGN name="local.SM_create_db_error" value="{ local.SM_create_db_error $ MvADD_Error $ '<BR>'}"> </MvIF> <MvCLOSE name="SM_form_list_db"> <MvIF EXPR="{MvCLOSE_Error}"> <MvASSIGN name="local.SM_create_db_error" value="{ local.SM_create_db_error $ MvCLOSE_Error $ '<BR>'}"> </MvIF> <MvCLOSE name="SM_new_form_db"> <MvIF EXPR="{MvCLOSE_Error}"> <MvASSIGN name="local.SM_create_db_error" value="{ local.SM_create_db_error $ MvCLOSE_Error $ '<BR>'}"> </MvIF> <MvCLOSE name="SM_new_form_att_db"> <MvIF EXPR="{MvCLOSE_Error}"> <MvASSIGN name="local.SM_create_db_error" value="{ local.SM_create_db_error $ MvCLOSE_Error $ '<BR>'}"> </MvIF> <MvComment> If there was an error creating the databases, let the user know </MvComment> <MvIF EXPR="{local.SM_create_db_error}"> <MvEVAL EXPR="{SM_header('SimpleMail Database Creation Failure')}"> <H2><font color="#FF0000">Error:</font></H2> Unfortunately, there was an error in the process of creating your mail form databases. The following errors were generated: <P><MvEVAL EXPR="{local.SM_create_db_error}"> <P>If you need assistance please feel free to contact Customer Support. <MvEVAL EXPR="{SM_footer()}"> <MvExit> </MvIF> <MvEVAL EXPR="{SM_modify_form_database()}"> </MvFUNCTION SM_create_form_database> <MvFUNCTION name="SM_create_form_database_precheck"> <MvIF EXPR="{ NOT SM_recheck_admin(SM_admin_name_good, SM_admin_password_good)}"> <MvEVAL EXPR="{SM_validate_admin_screen()}"> </MvIF> <MvComment>Strip spaces for safety</MvComment> <MvASSIGN name="SM_form_URL_input" value="{ ltrim(SM_form_URL_input) }"> <MvASSIGN name="SM_form_URL_input" value="{ rtrim(SM_form_URL_input) }"> <MvASSIGN name="SM_URL_filename" value="{SM_URL_to_filename(SM_form_URL_input)}"> <MvComment> First check the main form URL If everything is OK this error will be unset </MvComment> <MvIF EXPR="{SM_form_URL_input}"> <MvASSIGN name="SM_form_URL_input_error" value="{ 'The FORM tag in <B>' $ SM_form_URL_input $ '</B> is not specified correctly. Please see the example in the help file above.<BR>'}"> <MvCALL action="{SM_form_URL_input}" method="GET"> <MvIF EXPR="{ (callobjecttype CIN 'text') AND (substring(callvalue,'1','3') EQ '404')}"> <MvASSIGN name="SM_form_URL_input_error" value="404: The requested URL was not found"> <MvCALLSTOP> </MvIF> <MvIF EXPR="{ (callobjecttype CIN 'tag') AND (callobjectelement CIN 'form')}"> <MvASSIGN name="local.counter" value="1"> <MvWHILE EXPR="{local.counter LE callobjectnumattributes}"> <MvIF EXPR="{ callobjectattribute&[local.counter] CIN 'method'}"> <MvIF EXPR="{ 'post' EQ tolower(callobjectvalue&[local.counter]) }"> <MvASSIGN name="local.SM_method_ok" value="1"> <MvELSE> <MvASSIGN name="SM_form_URL_input_error" value="{ SM_form_URL_input_error $ 'You must use &quot;POST&quot; as the method in your FORM tag.<BR>' }"> </MvIF> </MvIF> <MvIF EXPR="{ callobjectattribute&[local.counter] CIN 'action'}"> <MvIF EXPR="{ callobjectvalue&[local.counter] EQ SM_documenturl }"> <MvASSIGN name="local.SM_action_ok" value="1"> <MvELSE> <MvASSIGN name="SM_form_URL_input_error" value="{ SM_form_URL_input_error $ 'You must use &quot;' $ SM_documenturl $ '&quot;<BR>for the action in your FORM tag instead of &quot;' $ callobjectvalue&[local.counter] $ '&quot; <BR>'}"> </MvIF> </MvIF> <MvASSIGN name="local.counter" value="{local.counter + 1}"> </MvWHILE> <MvIF EXPR="{local.SM_method_ok AND local.SM_action_ok}"> <MvASSIGN name="SM_form_URL_input_error" value=""> </MvIF> </MvIF> </MvCALL> <MvIF EXPR="{MvCALL_Error}"> <MvASSIGN name="SM_form_URL_input_error" value="{MvCALL_Error}"> </MvIF> <MvELSE> <MvASSIGN name="SM_form_URL_input_error" value="The URL field is mandatory."> </MvIF> <MvComment> Now check the destination e-mail address</MvComment> <MvIF EXPR="{SM_form_email_input}"> <MvASSIGN name="SM_create_form_database_email" value="{SM_clean_email_address(SM_form_email_input)}"> <MvIF EXPR="{substring(SM_create_form_database_email,'1','5') EQ 'Error'}"> <MvASSIGN name="SM_form_email_input_error" value="{SM_create_form_database_email}"> </MvIF> <MvELSE> <MvASSIGN name="SM_form_email_input_error" value="The e-mail field is mandatory."> </MvIF> <MvComment> If we found an error, send them back to the input screen </MvComment> <MvIF EXPR="{SM_form_URL_input_error OR SM_form_email_input_error}"> <MvASSIGN name="SM_form_input_error" value="1"> <MvEVAL EXPR="{SM_create_form_database_screen()}"> <MvExit> </MvIF> <MvComment> Otherwise, check to see if we are creating a new db or gonna read in an old one. </MvComment> <MvIF EXPR="{ fexists(SM_files $ SM_URL_filename $ '.dbf')}"> <MvASSIGN name="SM_not_really_new" value="1"> <MvEVAL EXPR="{SM_modify_form_database()}"> <MvELSE> <MvASSIGN name="SM_I_am_a_new_form" value="1"> <MvEVAL EXPR="{SM_create_form_database()}"> </MvIF> </MvFUNCTION SM_create_form_database_precheck> <MvFUNCTION name="SM_create_form_database_screen"> <MvIF EXPR="{ NOT SM_recheck_admin(SM_admin_name_good, SM_admin_password_good)}"> <MvEVAL EXPR="{SM_validate_admin_screen()}"> </MvIF> <MvASSIGN name="local.SM_short_url" value="{SM_make_short_URL(SM_documenturl)}"> <MvIF EXPR="{ NOT SM_first_time }"> <MvEVAL EXPR="{SM_header('SimpleMail Form Database Setup')}"> </MvIF> <H2>Setting up a new form</H2> There are two essential items needed to set up a new form for use with SimpleMail. All information related to a given mail form will be referred to in the database by the URL of your form. Therefore before you start the setup process the form must be uploaded to your account, and you should make a note of the complete URL. <I>essential</I> <P><I>If you have not yet set up a mail form for use with SimpleMail, please take a moment to look at the help file to familiarize yourself with the basics.</I><BR> <MvEVAL EXPR="{SM_std_FORM()}"> <input type="hidden" name="SM_return_to" value="SM_create_form_database_screen"> <input type="hidden" name="SM_action" value="SM_form_help"> <input type="hidden" name="SM_first_time" value="&[SM_first_time]"> <input type="submit" value="Setting up a SimpleMail HTML input or error form"></form> <P>Next, you need to know the e-mail address or addresses to which your mail from this form will be sent. You <B>MUST</B> set the e-mail destination for this form in the database. Creating a form that sends mail to random destinations is a violation of our Acceptable Use Policy for your account. <P>If you are ready to start the process of creating a database for your form, enter the URL here. Because of the way that certain browsers handle the 'http_referer' variable <I>it is highly recommended</I> that you not put your form on the index page in any document directory. It is better to put a link from the index page to the page which will have your form. <MvEVAL EXPR="{SM_std_FORM()}"> <MvASSIGN name="local.SM_URL_default" value="{local.SM_short_URL}"> <MvASSIGN name="local.SM_email_default" value="someone@some.com,someoneelse@another.com"> <input type="hidden" name="SM_action" value="SM_create_form_database_precheck"> <table border="0" align="center"> <MvIF EXPR="{SM_form_input_error}"> <MvIF EXPR="{SM_form_URL_input_error}"> <tr><td></td><td><font color="#FF0000"> <MvEVAL EXPR="{SM_form_URL_input_error}"></font></td></tr> <MvELSE> <MvASSIGN name="local.SM_URL_default" value="{SM_form_URL_input}"> </MvIF> </MvIF> <tr><th align="left">URL of your form:</th> <td><input type="text" name="SM_form_URL_input" value="&[local.SM_URL_default]" size="60" maxlength="250"></td></tr> <MvIF EXPR="{SM_form_input_error}"> <MvIF EXPR="{SM_form_email_input_error}"> <tr><td></td><td><font color="#FF0000"> <MvEVAL EXPR="{SM_form_email_input_error}"></font></td></tr> <MvELSE> <MvASSIGN name="local.SM_email_default" value="{SM_form_email_input}"> </MvIF> </MvIF> <tr><th align="left">Destination E-mail:</th> <td><input type="text" name="SM_form_email_input" value="&[local.SM_email_default]" size="60" maxlength="150"></td></tr> <tr><td align="center"></td> <td align=left><input type="submit" value="Start database creation"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="reset" value="Reset this form to defaults"></td></tr></table></form> <MvEVAL EXPR="{SM_footer()}"> <MvExit> </MvFUNCTION SM_create_form_database_screen> <MvFUNCTION name="SM_form_help"> <MvEVAL EXPR="{SM_header('Setting up a SimpleMail HTML form')}"> <H2>Basic steps for mail form setup</H2> For your convenience we have created a system that allows you to create a simple HTML mail form that will interact with the SimpleMail script in such a way that you do not need to do any CGI/Miva coding yourself. The only requirement is for you to add the line described below as the FORM tag in your HTML mail form. This tells your user's browser where to send the mail, namely to your SimpleMail script. <P>Your FORM tag must look <I><B>EXACTLY</B></I> like this. If you use something different it will not work. <P>&lt;FORM method=&quot;POST&quot; action=&quot;&[SM_documenturl]&quot;&gt; <P>You can use almost any label for the name=&quot; &quot; variables in your HTML form; however your variable names must not begin with the characters, &quot;SM_&quot; or they will conflict with the internal SimpleMail variables. Also, <A HREF="http://www.miva.com/">Miva</a> requires that all variable names contain only the characters A-Z, a-z, 0-9, and '_' (underscore). <P>Unfortunately, due to limitations in Miva you cannot use CGI tags where the input type is an image or a file, and if you use a &lt;select&gt; tag you cannot use the &quot;multiple&quot; attribute in that tag. <P>Because of the way that certain browsers handle the 'http_referer' variable it is highly recommended that you <B>not</B> put your form on the index page in any document directory. It is better to put a link from the index page to the page which will have your form. Also, you will get better results if you use only one form per HTML page. <P>If you change the name of a variable in your form, you <I>must</I> recreate the database for that form. <H2>Simple mail form</H2> This is an extremely basic mail form, including the FORM line described above: <P>&lt;HTML&gt;<BR> &lt;HEAD&gt;<BR> &lt;TITLE&gt;Very Simple Mail Form&lt;/TITLE&gt;<BR> &lt;/HEAD&gt;<BR> &lt;BODY&gt;<BR> This is my very simple mail form<BR> <P>&lt;!-- The line below is essential and must be included --&gt;<BR> &lt;FORM method=&quot;POST&quot; action=&quot;&[SM_documenturl]&quot;&gt; <P>&lt;P&gt;Put your From: e-mail address here:&lt;BR&gt;<BR> &lt;input type=&quot;text&quot; name=&quot;users_email&quot; value=&quot;me@me.com&quot; maxlength=&quot;50&quot; size=&quot;50&quot;&gt;<BR> <P>&lt;P&gt;Put your message here:&lt;BR&gt;<BR> &lt;textarea name=&quot;users_message&quot; cols=&quot;70&quot; rows=&quot;10&quot;&gt;&lt;/textarea&gt;<BR> <P>&lt;P&gt;&lt;input type=&quot;submit&quot; value=&quot;Send my mail&quot;&gt;<BR> &lt;/FORM&gt;<BR> &lt;/BODY&gt;<BR> &lt;/HTML&gt; <P>You can copy the above text and paste it into a file which you can upload to your account. This will give you a basic idea of how the form works together with SimpleMail. Make sure that you save your file as plain text, sometimes called ASCII text. <H2>Simple error form</H2> You can specify that fields in your form have certain properties in the form database. If your user enters something in your form that does not match the attributes you have specified, they will receive an error message from a URL whose HTML source looks like this: <P>&lt;HTML&gt;<BR> &lt;HEAD&gt;<BR> &lt;TITLE&gt;Form Error&lt;/TITLE&gt;<BR> &lt;/HEAD&gt;<BR> &lt;BODY bgcolor=&quot;#FFFFFF&quot;&gt;<BR> &lt;Center&gt;&lt;H1&gt;&lt;font color="#FF0000"&gt;Form Error&lt;/font&gt;&lt;/H1&gt;&lt;/Center&gt;<BR> One or more of the fields that you entered into the form was not correct. Here is a summary of the errors: <P>&lt;P&gt;&lt;blockquote&gt;<BR> ##List of errors here##<BR> &lt;/blockquote&gt; <P>Please use your browser's [Back] button to return to the form and correct any errors.<BR> &lt;/BODY&gt;<BR> &lt;/HTML&gt; <P>If you would like to specify that your user receive a customized error message you can create a page with source similar to the one above and specify the URL in your form database. Wherever you place the &quot;##List of errors here##&quot; pseudo-tag it will be replaced with the actual list of errors generated by the user's input. <P>If you choose to make a field mandatory, you should give special attention to the name of that field. Your user will receive an error message similar to: <P><blockquote>This field is mandatory: users_email</blockquote> If the name of the field is not fairly self-explanatory your user may become confused as to which field was not filled in properly. <P>You can use this error form as a sample like the sample mail form above if you would like to see how it works. However an error URL is <B><I>not</I></B> mandatory if the simple message above is sufficient for your needs.<P> <MvIF EXPR="{SM_return_to}"> <MvEVAL EXPR="{SM_std_FORM()}"> <input type="hidden" name="SM_action" value="&[SM_return_to]"> <input type="submit" value="Return me to the previous page"></FORM> </MvIF> <MvIF EXPR="{ ((NOT SM_first_time) AND (SM_admin_name_good)) }"> <MvEVAL EXPR="{SM_go_admin_menu()}"> <MvELSE> <H2><font color="#FF0000">Error:</font></H2> There was an error creating the &quot;<MvEVAL EXPR="{SM_dir}">&quot; directory within your mivadata directory. This is an essential step for SimpleMail setup. <P>If you need assistance please feel free to contact Customer Support. <MvEVAL EXPR="{SM_footer()}"> <MvExit> </MvIF> </MvIF> <MvComment> Test the values for errors </MvComment> <MvIF EXPR="{ asciichar(32) IN SM_admin_name_input }"> <MvASSIGN name="SM_admin_name_error" value="Your username cannot contain a space."> </MvIF> <MvIF EXPR="{ NOT SM_admin_name_input }"> <MvASSIGN name="SM_admin_name_error" value="A username is mandatory."> </MvIF> <MvIF EXPR="{ NOT SM_admin_name_error }"> <MvASSIGN name="SM_admin_name_input_good" value="{SM_admin_name_input}"> </MvIF> <MvIF EXPR="{SM_admin_pass_input1 NE SM_admin_pass_input2}"> <MvASSIGN name="SM_admin_pass_error" value="The password must be the same both times."> </MvIF> <MvIF EXPR="{ (asciichar(32) IN SM_admin_pass_input1) OR (asciichar(32) IN SM_admin_pass_input2) }"> <MvASSIGN name="SM_admin_pass_error" value="Your password cannot contain a space."> </MvIF> <MvIF EXPR="{ (NOT SM_admin_pass_input1) OR (NOT SM_admin_pass_input2) }"> <MvASSIGN name="SM_admin_pass_error" value="A password is mandatory."> </MvIF> <MvIF EXPR="{ NOT SM_admin_pass_error }"> <MvASSIGN name="SM_admin_pass_input_good" value="{SM_admin_pass_input1}"> </MvIF> <MvIF EXPR="{SM_admin_email_input}"> <MvASSIGN name="SM_admin_database_email" value="{SM_clean_email_address(SM_admin_email_input)}"> <MvIF EXPR="{substring(SM_admin_database_email,'1','5') EQ 'Error'}"> <MvASSIGN name="SM_admin_email_error" value="{SM_admin_database_email }"> </MvIF> <MvELSE> <MvASSIGN name="SM_admin_email_error" value="The e-mail field is mandatory."> </MvIF> <MvIF EXPR="{ NOT SM_admin_email_error }"> <MvASSIGN name="SM_admin_email_input_good" value="{SM_admin_database_email}"> </MvIF> <MvIF EXPR="{ SM_admin_name_error OR SM_admin_pass_error OR SM_admin_email_error }"> <MvASSIGN name="SM_admin_input_error" value="1"> <MvEVAL EXPR="{SM_create_admin_database_screen()}"> <MvExit> </MvIF> <MvIF EXPR="{fexists(SM_admin_database)}"> <MvIF EXPR="{ NOT fdelete(SM_admin_database) }"> <MvEVAL EXPR="{SM_header('SimpleMail Database Deletion Failure')}"> <H2><font color="#FF0000">Error:</font></H2> Unfortunately, there was an error in the process of deleting your administration database. <P>If you need assistance please feel free to contact Customer Support. <MvEVAL EXPR="{SM_footer()}"> <MvExit> </MvIF> </MvIF> <MvCREATE name="SM_admin_db" database="{SM_admin_database}" fields=" SM_name CHAR(50), SM_pass CHAR(50), SM_email CHAR(50)"> <MvASSIGN name="SM_admin_db.d.SM_name" value="{SM_admin_name_input}"> <MvASSIGN name="SM_admin_db.d.SM_pass" value="{SM_admin_pass_input1}"> <MvASSIGN name="SM_admin_db.d.SM_email" value="{SM_admin_database_email}"> <MvADD name="SM_admin_db"> <MvIF EXPR="{Mv_ADD_Error}"> <MvEVAL EXPR="{SM_header('SimpleMail Administration Database Creation Error')}"> <H2><font color="#FF0000>ERROR:</font></H2> Creation of your administration database failed with the following error: <P><MvEVAL EXPR="{Mv_ADD_Errror}"> </h2> <P>Please correct this error and try again. <P>If you need assistance please feel free to contact Customer Support. <MvEVAL EXPR="{SM_footer()}"> <MvExit> </MvIF> <MvEVAL EXPR="{SM_header('SimpleMail Administration Database Creation')}"> <MvIF EXPR="{SM_first_time}"> <H2>Step One:</H2> </MvIF> <H3>Your administrator database has been created with the following values:</H3> Username: <B>Username:</B> <MvEVAL EXPR="{SM_admin_db.d.SM_name}"><BR> Password: <B>Password:</B> <MvEVAL EXPR="{SM_admin_db.d.SM_pass}"><BR> E-mail: <B>E-mail:</B> <MvEVAL EXPR="{encodeentities(SM_admin_db.d.SM_email)}"> <MvASSIGN name="SM_admin_name_good" value="{SM_admin_db.d.SM_name}"> <MvASSIGN name="SM_admin_password_good" value="{SM_admin_db.d.SM_pass}"> <MvCLOSE name="SM_admin_db"> <MvIF EXPR="{SM_first_time}"> <H2>Step Two:</H2> Now that you have administrator access to your mail system, your next step is to set up a SimpleMail database for your HTML mail form. <MvEVAL EXPR="{SM_create_form_database_screen()}"> <MvExit> <MvELSE> <MvASSIGN name="SM_no_admin_header" value="1"> <MvEVAL EXPR="{SM_admin_menu()}"> </MvIF> </MvFUNCTION SM_create_admin_database> <MvFUNCTION name="SM_create_admin_database_screen"> <MvIF EXPR="{ NOT SM_recheck_admin(SM_admin_name_good, SM_admin_password_good)}"> <MvEVAL EXPR="{SM_validate_admin_screen()}"> </MvIF> <MvEVAL EXPR="{SM_header('SimpleMail Administrator Database Creation')}"> <H2>Administrator Database Creation</H2> It is very important that you remember your password because you will not be able to retrieve it from the database in a form that you can read. <B><I>very important</I></B> <P>The name you choose here will never be displayed to users. It is only used to identify you to the SimpleMail administration password validator. <P>If an error is generated by SimpleMail from input POST'ed to it by your form, the e-mail address you enter here will be displayed with an informative message telling the user to mail you. <MvEVAL EXPR="{SM_std_FORM()}"> <input type="hidden" name="SM_action" value="SM_create_admin_database"> <MvHIDE fields="SM_first_time"> <MvIF EXPR="{ SM_admin_name_good AND (NOT SM_first_time) }"> <MvASSIGN name="local.SM_admin_name_default" value="{SM_admin_name_good}"> <MvELSE> <MvASSIGN name="local.SM_admin_name_default" value="WhoRU?"> </MvIF> <MvIF EXPR="{ SM_admin_password_good AND (NOT SM_first_time) }"> <MvASSIGN name="local.SM_admin_pass_default" value="{SM_admin_password_good}"> </MvIF> <MvIF EXPR="{ SM_admin_email_good }"> <MvASSIGN name="local.SM_admin_email_default" value="{SM_admin_email_good}"> <MvELSE> <MvLOCKFILE file="{SM_admin_database}"> <MvOPEN name="SM_admin_db" database="{SM_admin_database}"> <MvASSIGN name="local.SM_admin_email_default" value="{SM_admin_db.d.SM_email}"> <MvCLOSE name="SM_admin_db"> </MvLOCKFILE> </MvIF> <table border="0" align="center"> <MvIF EXPR="{SM_admin_input_error}"> <MvIF EXPR="{SM_admin_name_error}"> <tr><td></td><td><font color="#FF0000"><MvEVAL EXPR="{SM_admin_name_error}"></font></td></tr> <MvELSE> <MvASSIGN name="local.SM_admin_name_default" value="{SM_admin_name_input_good}"> </MvIF> </MvIF> <tr><th align="left">Username:</th> <td><input type="text" name="SM_admin_name_input" value="&[local.SM_admin_name_default]" maxlength="50" size="50"></td></tr> <MvIF EXPR="{SM_admin_input_error}"> <MvIF EXPR="{SM_admin_pass_error}"> <tr><td></td><td><font color="#FF0000"><MvEVAL EXPR="{SM_admin_pass_error}"></font></td></tr> <MvELSE> <MvASSIGN name="local.SM_admin_pass_default" value="{SM_admin_pass_input_good}"> </MvIF> </MvIF> <tr><th align="left">Password:</th> <td><input type="password" name="SM_admin_pass_input1" value="&[local.SM_admin_pass_default]" maxlength="50" size="50"></td></tr> <tr><th align="left">Re-type Password:</th> <td><input type="password" name="SM_admin_pass_input2" value="&[local.SM_admin_pass_default]" maxlength="50" size="50"></td></tr> <MvIF EXPR="{SM_admin_input_error}"> <MvIF EXPR="{SM_admin_email_error}"> <tr><td></td><td><font color="#FF0000"><MvEVAL EXPR="{SM_admin_email_error}"></font></td></tr> <MvELSE> <MvASSIGN name="local.SM_admin_email_default" value="{SM_admin_email_input_good}"> </MvIF> </MvIF> <tr><th align="left">E-mail:</th> <td><input type="text" name="SM_admin_email_input" value="&[local.SM_admin_email_default]" maxlength="50" size="50"></td></tr> <tr><td></td><td align=left><input type="submit" value="Create my administration database">&nbsp;&nbsp;&nbsp;<input type=reset></td></tr></table></form> <MvEVAL EXPR="{SM_footer()}"> <MvExit> </MvFUNCTION SM_create_admin_database_screen> <MvComment> Since no admin database exists yet, and we want to use the same code to create a new db as we do to change an existing one, we need to prime the pump with something, so we fake one up. </MvComment> <MvFUNCTION name="SM_fake_first_time_db"> <MvIF EXPR="{fexists(SM_admin_database)}"> <MvEVAL EXPR="{SM_validate_admin_screen()}"> </MvIF> <MvIF EXPR="{NOT fexists(SM_dir)}"> <MvIF EXPR="{NOT fmkdir(SM_dir)}"> <MvEVAL EXPR="{SM_header('SimpleMail Administrator Database Creation Error')}"> <H2><font color="#FF0000">Error:</font></H2> There was an error creating the directory within your mivadata directory. This is an essential step for SimpleMail setup. <TT><MvEVAL EXPR="{SM_dir}"></TT> <TT>mivadata</TT> <P>If you need assistance please feel free to contact Customer Support. <MvEVAL EXPR="{SM_footer()}"> <MvExit> </MvIF> </MvIF> <MvCREATE name="SM_admin_db" database="{SM_admin_database}" fields=" SM_name CHAR(50), SM_pass CHAR(50), SM_email CHAR(50)"> <MvASSIGN name="SM_admin_db.d.SM_name" value="fooby"> <MvASSIGN name="SM_admin_db.d.SM_pass" value="barby"> <MvASSIGN name="SM_admin_db.d.SM_email" value="I.H@te.bugs"> <MvADD name="SM_admin_db"> <MvIF EXPR="{Mv_ADD_Error}"> <MvEVAL EXPR="{SM_header('SimpleMail Administration Database Creation Error')}"> <H2><font color="#FF0000>ERROR:</font></H2> Pre-Creation of your administration database failed with the following error: <P><MvEVAL EXPR="{Mv_ADD_Errror}"> </h2> <P>Please correct this error and try again. <P>If you need assistance please feel free to contact Customer Support. <MvEVAL EXPR="{SM_footer()}"> <MvExit> </MvIF> <MvCLOSE name="SM_admin_db"> <MvASSIGN name="SM_admin_name_good" value="fooby"> <MvASSIGN name="SM_admin_password_good" value="barby"> <MvEVAL EXPR="{SM_create_admin_database_screen()}"> </MvFUNCTION SM_fake_first_time_db> <MvFUNCTION name="SM_first_time_setup_screen"> <MvEVAL EXPR="{SM_header('SimpleMail Administration')}"> <H2>First time setup for administrators</H2> If this is the very first time you have ever run SimpleMail, or your previous SimpleMail administration files have somehow been deleted, this page is the first step in setting up your installation. <B><I>very first</I></B> <P><Center><font color="#FF0000">Please bookmark this page now so that you can return later if you need to add forms or make changes.</font></Center> <P>The SimpleMail script creates a database for each form which you wish to receive mail from. That database holds all of the information about your form, including how and where to send the mail. <P>Because SimpleMail uses the URL of your form to identify the information related to it in the database, before you can add a mail form for processing you must create the form and upload it to your account. If you have not already, please take a minute to view the help page, then return here and continue your setup. <FORM method="POST" action="&[SM_documenturl]"> <input type="hidden" name="SM_action" value="SM_form_help"> <input type="hidden" name="SM_return_to" value="SM_first_time_setup_screen"> <input type="hidden" name="SM_first_time" value="1"> <P><input type="submit" value="Setting up a SimpleMail HTML form"></form> <H2>Step One:</H2> If you have a mail form ready to go, the first thing you need to do is to choose a name and password for the SimpleMail administrator. <FORM method="POST" action="&[SM_documenturl]"> <input type="hidden" name="SM_action" value="SM_fake_first_time_db"> <input type="hidden" name="SM_first_time" value="1"> <P><input type="submit" value="Take me to the administration database creation form"></form> <MvEVAL EXPR="{SM_footer()}"> <MvExit> </MvFUNCTION SM_first_time_setup_screen> <MvFUNCTION name="SM_delete_all_files"> <MvIF EXPR="{NOT SM_recheck_admin(SM_admin_name_good, SM_admin_password_good)}"> <MvEVAL EXPR="{SM_validate_admin_screen()}"> </MvIF> <MvIF EXPR="{fexists(SM_form_list_database)}"> <MvLOCKFILE file="{SM_form_list_database}"> <MvOPEN name="SM_form_list_db" database="{SM_form_list_database}"> <MvWHILE EXPR="{ NOT SM_form_list_db.d.EOF }"> <MvIF EXPR="{fexists(SM_files $ SM_form_list_db.d.SM_frm_lst $ '.dbf')}"> <MvIF EXPR="{ NOT fdelete(SM_files $ SM_form_list_db.d.SM_frm_lst $ '.dbf')}"> <MvASSIGN name="SM_delete_files_error" value="{ SM_delete_files_error $ SM_files $ SM_form_list_db.d.SM_frm_lst $ '.dbf<BR>' }"> </MvIF> </MvIF> <MvIF EXPR="{fexists(SM_files $ SM_form_list_db.d.SM_frm_lst $ '.dbt')}"> <MvIF EXPR="{ NOT fdelete(SM_files $ SM_form_list_db.d.SM_frm_lst $ '.dbt')}"> <MvASSIGN name="SM_delete_files_error" value="{ SM_delete_files_error $ SM_files $ SM_form_list_db.d.SM_frm_lst $ '.dbt<BR>' }"> </MvIF> </MvIF> <MvIF EXPR="{fexists(SM_files $ SM_form_list_db.d.SM_frm_lst $ '-att.dbf')}"> <MvIF EXPR="{ NOT fdelete(SM_files $ SM_form_list_db.d.SM_frm_lst $ '-att.dbf')}"> <MvASSIGN name="SM_delete_files_error" value="{ SM_delete_files_error $ SM_files $ SM_form_list_db.d.SM_frm_lst $ '-att.dbf<BR>' }"> </MvIF> </MvIF> <MvSKIP name="SM_form_list_db"> </MvWHILE> <MvCLOSE name="SM_form_list_db"> </MvLOCKFILE> <MvIF EXPR="{ NOT fdelete(SM_form_list_database)}"> <MvASSIGN name="SM_delete_files_error" value="{ SM_delete_files_error $ SM_form_list_database '<BR>' }"> </MvIF> </MvIF> <MvIF EXPR="{fexists(SM_admin_database)}"> <MvIF EXPR="{ NOT fdelete(SM_admin_database)}"> <MvASSIGN name="SM_delete_files_error" value="{ SM_delete_files_error $ SM_admin_database '<BR>' }"> </MvIF> </MvIF> <MvEVAL EXPR="{SM_header('SimpleMail Uninstall')}"> <H2>Uninstall</H2> All possible SimpleMail files have been deleted. At this time, it is not possible for Miva to delete directories, so if you want to delete the directory that is currently in the mivadata directory on your account, you will have to do that by hand. <A HREF="http://www.miva.com/"></a> <TT><MvEVAL EXPR="{SM_dir}"></TT> <TT>mivadata</TT> <MvIF EXPR="{SM_delete_files_error}"> <P>Unfortunately there was a problem deleting the following files in the <TT><MvEVAL EXPR="{SM_dir}"></TT> directory. You will have to remove them by hand. <P><blockquote><MvEVAL EXPR="{SM_delete_files_error}"></blockquote> </MvIF> <P>If you need assistance please feel free to contact Customer Support. <P>We hope you enjoyed using SimpleMail. <MvEVAL EXPR="{SM_footer()}"> <MvExit> </MvFUNCTION SM_delete_all_files> <MvFUNCTION name="SM_delete_all_files_screen"> <MvIF EXPR="{ NOT SM_recheck_admin(SM_admin_name_good, SM_admin_password_good)}"> <MvEVAL EXPR="{SM_validate_admin_screen()}"> </MvIF> <MvEVAL EXPR="{SM_header('SimpleMail File Deletion')}"> <Center><H1><B><font color="#FF0000">Are you <I>SURE</I>? </font></b></h1></Center> If you delete your SimpleMail installation ALL of your SimpleMail database files will be permanently deleted. Although there will be no way to recover any of the database files; your mail forms, the SimpleMail script itself and any text copies of mail sent by SimpleMail will not be deleted. <B><I>ALL</I></B> <P>If deleting SimpleMail is not what you had in mind, you should hit the [Back] button on your browser now. <P>If you are really <I>really</I> sure that this is what you want to do, press the button. <MvEVAL EXPR="{SM_std_FORM()}"> <input type="hidden" name="SM_action" value="SM_delete_all_files"> <Center><input type="submit" value="Yes, PERMANENTLY delete ALL of my SimpleMail files"></Center></form> <MvEVAL EXPR="{SM_footer()}"> <MvExit> </MvFUNCTION SM_delete_all_files_screen>