Βοήθεια σε dynamic form (μετατροπή)

Βοήθεια λύσεις και νέα από τον χώρο των open source ή έτοιμων εφαρμογών που έχουν φτιαχτεί με την PHP όπως oscommerce, κ.α.

Συντονιστές: WebDev Moderators, Super-Moderators, PHP Moderators

Απάντηση
TreeRivers
Δημοσιεύσεις: 2
Εγγραφή: 22 Απρ 2007 00:46

Βοήθεια σε dynamic form (μετατροπή)

Δημοσίευση από TreeRivers » 05 Ιουν 2007 15:21

Kalispera sas, opos leo ston titlo thelo na kano mia prosthiki stin dynamic form pou exo, lipon thelo ota erxete to e-mail ap ti forma na me emfanizei tin ip tou pc pou exei stalei to minima tin ora/imerominia pou exei stali. Prospatho poli kairo alla den exo vgalei akri parakato vazo tin dynamic form kai pio kato ti forma, opios mporei na voithisi euxaristo ek ton proteron...


Dynamic Form
--------------------------

Κώδικας: Επιλογή όλων



<?

// ##########################################################################
// ##########################################################################
//
//  DynaForm v1.4 - Created by the Webligo Group
//                  http&#58;//www.webligo.com
//
//  YOUR USE OR DISTRIBUTION OF THIS SOFTWARE CONSTITUTES YOUR ACCEPTANCE
//  OF THE FOLLOWING LICENSE AGREEMENT&#58; 
//
//  THIS SCRIPT AND ALL OF ITS CONTENTS ARE LICENSED UNDER THE
//  GPL FREEWARE LICENSE. IT MAY NOT BE RESOLD OUR USED COMMERCIALLY
//  WITHOUT EXPRESSED PERMISSION OF THE WEBLIGO GROUP. IT MAY, HOWEVER,
//  BE DISTRIBUTED FREELY WITHOUT CHARGE. THIS SOFTWARE IS INTELLECTUAL
//  PROPERTY OF THE WEBLIGO GROUP. ANYONE VIOLATING THIS AGREEMENT WITHOUT
//  THE EXPRESSED PERMISSION OF THE WEBLIGO GROUP MAY BE LEGALLY PROSECUTED.
//  YOUR DOWNLOAD AND USE OF THIS SOFTWARE ALSO SIGNIFIES THAT YOU UNDERSTAND
//  AND AGREE TO THE DOWNLOAD AGREEMENT YOU READ UPON DOWNLOAD.
//
//  The Webligo Group, its management, or any of its employees, associates, or 
//  partners cannot be held liable for any damages that this software may cause. 
//  As the Licensee and user of the software, you agree to accept full liability 
//  for any damages or risk involved with using this software.
//
//  If you need help installing or using this software, please
//  read the readme.txt file that was provided with it.
//
//  This file and all related content are the intellectual
//  property of the Webligo Group and are under copyright.
//
//  If you plan to use this script for your clients, sell it as a service,
//  or utilize it in any other commercial manner, you must purchase a commercial
//  license. Please see this page for more information&#58;
//  http&#58;//webligo.com/products_dynaform.php
//
//  We do not provide support for this script, unless you have purchased a
//  commercial license.
//
//  Feel free to visit our website &#40;http&#58;//www.webligo.com&#41;
//  if you wish to send us any comments, etc.
//
// ###########################################################################
// ###########################################################################





// ###########################################################################
// #### CONFIGURE FROM&#58; ADDRESS ##############################################

// THIS AREA IS OPTIONAL. ONLY TOUCH THESE SETTINGS IF YOU KNOW WHAT YOU ARE
// DOING. PLEASE READ README.TXT FOR MORE INFORMATION.

// If you would like to specify the From&#58; address of emails sent by DynaForm,
// enter it between the double quotes below. If you leave this blank, the
// server will assign the default email address.

$from_address = "info@domain.gr";

// ###########################################################################
// ###########################################################################





// ###########################################################################
// #### ACTIVATE REQUIRED FIELDS? ############################################

// THIS AREA IS OPTIONAL. ONLY TOUCH THESE SETTINGS IF YOU KNOW WHAT YOU ARE
// DOING. PLEASE READ README.TXT FOR MORE INFORMATION.
//
// If you would like to make some fields of your form required, change "no" to
// "yes" below.

$required_on = "no";

// If you have set $required_on to "yes" above, you can make fields required
// by beginning their name with "r_". For example, if you want to require
// a user to enter their name, use the following HTML&#58;
//
// <input type='text' name='r_Name'>
//
// If a user fails to enter a required field, they will be taken to a page
// where a message such as "You have not completed all the required fields."
// will be displayed. Please specify the URL to this file below&#58;

$required_errorpage = "error.html";

// ###########################################################################
// ###########################################################################





// ###########################################################################
// #### OVERRIDE REQUIRED VARIABLES? #########################################

// THIS AREA IS OPTIONAL. ONLY TOUCH THESE SETTINGS IF YOU KNOW WHAT YOU ARE
// DOING. PLEASE READ README.TXT FOR MORE INFORMATION. NOTE&#58; THIS WILL NOT
// AFFECT YOUR 'TURN ON REQUIRED FIELDS?' SECTION SETTINGS ABOVE.
//
// If you would like to override the three required variables in
// order to hide your email address, email subject, and thank you page
// URL from your email form, change "no" to "yes" below.

$override = "yes";

// If override is set to "yes", the hidden variables on your HTML
// email form named "rec_mailto", "rec_subject", and "rec_thanks" will be
// overridden and can therefore be removed from the form.

// If you have set override to "yes" above, you must specify new values for
// each of these variables below.


// Enter the email subject.
$incoming_subject = "domain - Massege from user";

// Enter the thank you page URL.
$incoming_thanks = "http&#58;//www.domain.gr/thanks.html";

// ###########################################################################
// ###########################################################################





// ###########################################################################
// #### BAN IP ADDRESSES? ####################################################

// THIS AREA IS OPTIONAL. ONLY TOUCH THESE SETTINGS IF YOU KNOW WHAT YOU ARE
// DOING. PLEASE READ README.TXT FOR MORE INFORMATION.
//
// If you would like to ban certain IP addresses from submitting your form,
// change "no" to "yes" below.

$ban_ip_on = "no";

// If you have set $ban_ip_on to "yes" above, please enter a list of the
// IP addresses you would like to ban, seperated only by commas.
// An example has been provided below&#58;

$ban_ip_list = "111.222.33.55,11.33.777.99";

// ###########################################################################
// ###########################################################################





// ###########################################################################
// #### ACTIVATE DOMAIN SECURITY? ############################################
//
// THIS AREA IS OPTIONAL. ONLY TOUCH THESE SETTINGS IF YOU KNOW WHAT YOU ARE
// DOING. PLEASE READ README.TXT FOR MORE INFORMATION.
//
// This setting, when set to "yes" &#40;default&#41;, will check to make sure other
// people are not submitting data to your dynaform.php file from their
// external domains. This means that if your domain name is "www.mysite.com",
// only forms on "www.mysite.com" will be able to use this dynaform.php.
// IF YOU ARE RECEIVING ERRORS SUCH AS "INVALID DOMAIN" FOR NO REASON, PLEASE
// CHANGE "yes" TO "no" BELOW.

$secure_domain_on = "no";

// ###########################################################################
// ###########################################################################




// ###########################################################################
// #### ACTIVATE AUTO-RESPONSE? ##############################################
//
// THIS AREA IS OPTIONAL. ONLY TOUCH THESE SETTINGS IF YOU KNOW WHAT YOU ARE
// DOING. PLEASE READ README.TXT FOR MORE INFORMATION.
//
// This setting, when set to "yes", will make DynaForm automatically reply to
// the user who submitted your form with an email message. If you would like
// to use this feature, change "no" to "yes" below.

$autorespond_on = "yes";

// If you have set $autorespond_on to "yes" above, you must specify a subject,
// from-address, and message to include in the auto-response email.

// The following setting is the subject of the auto-response email&#58;
$autorespond_subject = "Your Form Submission";

// The following setting is the from-address of the auto-respond email&#58;
$autorespond_from = "info@domain.gr";

// The following setting is the message of your auto-response email&#58;
$autorespond_contents = "domain Your submission from our website has been received. Thank you!";

// DynaForm also needs to know how to retrieve the user's email address.
// You must specify the name of the field into which the user will enter
// their email address. For example, if your email form contains an input
// field like "<input type='text' name='Email'>" you would set the
// following setting to "Email".
$autorespond_mailto_field = "Email";

// ###########################################################################
// ###########################################################################










// MAKE SURE DYNAFORM IS NOT BEING LOADED FROM THE URL
if&#40;$HTTP_SERVER_VARS&#91;'REQUEST_METHOD'&#93; == "GET"&#41; &#123;
echo "
<html>
<head><title>domain</title></head>
<body>
<font style='font-family&#58; verdana, arial; font-size&#58; 9pt;'>
<b>DynaForm is installed correctly.</b></font><br>
<font style='font-family&#58; verdana, arial; font-size&#58; 8pt;'>
DynaForm Easy PHP Form Mailer was created by <a href='http&#58;//www.domain.gr/domain.html'>domain</a>.
</font>
</body></html>
";
exit&#40;&#41;;
&#125;

// SET VARIABLES
$incoming_fields = array_keys&#40;$HTTP_POST_VARS&#41;;
$incoming_values = array_values&#40;$HTTP_POST_VARS&#41;;

if&#40;$override == "no"&#41; &#123;
$incoming_mailto = @$HTTP_POST_VARS&#91;'rec_mailto'&#93;;
$incoming_subject = @$HTTP_POST_VARS&#91;'rec_subject'&#93;;
$incoming_thanks = @$HTTP_POST_VARS&#91;'rec_thanks'&#93;;
&#125;

$incoming_mailto_cc = @$HTTP_POST_VARS&#91;'opt_mailto_cc'&#93;;
$incoming_mailto_bcc = @$HTTP_POST_VARS&#91;'opt_mailto_bcc'&#93;;
$form_url = @$HTTP_REFERER;

// MAKE SURE DYNAFORM IS BEING RUN FROM THE RIGHT DOMAIN
if&#40;$secure_domain_on == "yes"&#41; &#123;
$form_url_array = parse_url&#40;$form_url&#41;;
$form_domain = $form_url_array&#91;host&#93;;
if&#40;$form_domain != $HTTP_SERVER_VARS&#91;HTTP_HOST&#93;&#41; &#123;
echo "<h2>DynaForm Error - Invalid Domain</h2>
You have accessed DynaForm from an external domain - this is not allowed.<br>
You may only submit forms to a DynaForm file that exists on the same domain name.<br>
If you believe to be receiving this message in error, please refer to your readme.txt file.
<br><br>";
$error = "yes";
&#125;
&#125;

// CHECK IF MAILTO IS SET
if&#40;$incoming_mailto == ""&#41; &#123;
echo "<h2>DynaForm Error - Missing Field</h2>
Your form located at <a href='$form_url'>$form_url</a> does not work because you forgot to include
the required \"<b>rec_mailto</b>\" field within the form. This field specifies who the email will
be sent to.
<br><br>
This should look like&#58;<br>
<input type=\"hidden\" name=\"rec_mailto\" value=\"info@domain.gr\">
<br><br>
If you are still confused, please refer to the readme.txt for more information and examples.<br><br><br><br>
";
$error = "yes";
&#125;

// CHECK IF SUBJECT IS SET
if&#40;$incoming_subject == ""&#41; &#123;
echo "<h2>DynaForm Error - Missing Field</h2>
Your form located at <a href='$form_url'>$form_url</a> does not work because you forgot to include
the required \"<b>rec_subject</b>\" field within the form. This field specifies the subject of
the email that will be sent.
<br><br>
This should look like&#58;<br>
<input type=\"hidden\" name=\"rec_subject\" value=\"New DynaForm Email\">
<br><br>
If you are still confused, please refer to the readme.txt for more information and examples.<br><br><br><br>
";
$error = "yes";
&#125;

// CHECK IF THANKS IS SET
if&#40;$incoming_thanks == ""&#41; &#123;
echo "<h2>DynaForm Error - Missing Field</h2>
Your form located at <a href='$form_url'>$form_url</a> does not work because you forgot to include
the required \"<b>rec_thanks</b>\" field within the form. This field specifies what page the user
will be taken to after they submit the form.
<br><br>
This should look like&#58;<br>
<input type=\"hidden\" name=\"rec_thanks\" value=\"http&#58;//www.domain.gr/thanks.html\">
<br><br>
If you are still confused, please refer to the readme.txt for more information and examples.<br><br><br><br>
";
$error = "yes";
&#125;

// CHECK IF IP ADDRESS IS BANNED
if&#40;$ban_ip_on == "yes"&#41; &#123;

if&#40;strstr&#40;$ban_ip_list, $HTTP_SERVER_VARS&#91;REMOTE_ADDR&#93;&#41;&#41; &#123;
echo "<h2>DynaForm Error - Banned IP</h2>
You cannot use this form because your IP address has been banned by the administrator.<br>
";
$error = "yes";
&#125;
&#125;


if&#40;$error == "yes"&#41; &#123;
exit&#40;&#41;;
&#125;

// SET EMAIL INTRODUCTION
$message = "This email was received from your MailForm located at $form_url \n\n";

// LOAD EMAIL CONTENTS 
for &#40;$i = 0; $i < count&#40;$incoming_fields&#41;; $i++&#41; &#123; 
if&#40;$incoming_fields&#91;$i&#93; != "rec_mailto"&#41; &#123;
if&#40;$incoming_fields&#91;$i&#93; != "rec_subject"&#41; &#123;
if&#40;$incoming_fields&#91;$i&#93; != "rec_thanks"&#41; &#123;
if&#40;$incoming_fields&#91;$i&#93; != "opt_mailto_cc"&#41; &#123;
if&#40;$incoming_fields&#91;$i&#93; != "opt_mailto_bcc"&#41; &#123;

// CHECK FOR REQUIRED FIELDS IF ACTIVATED
if&#40;$required_on == "yes"&#41; &#123;
$sub = substr&#40;$incoming_fields&#91;$i&#93;, 0, 2&#41;;
if&#40;$sub == "r_"&#41; &#123;
if&#40;$incoming_values&#91;$i&#93; == "" OR !isset&#40;$incoming_values&#91;$i&#93;&#41; OR $incoming_values&#91;$i&#93; == " "&#41; &#123;
header&#40;"Location&#58; $required_errorpage"&#41;;
exit&#40;&#41;;
&#125;&#125;&#125;

// ADD FIELD TO OUTGOING MESSAGE
$message .= "$incoming_fields&#91;$i&#93;&#58;\n$incoming_values&#91;$i&#93;\n\n";
&#125;&#125;&#125;&#125;&#125;&#125;

// SET EMAIL FOOTER
$message .= "\n\n domain Contact Contact.\n\nVisit us at&#58; http&#58;//www.domain.gr";

// CLEAR HEADERS
$headers = "";

// ADD FROM ADDRESS
if&#40;$from_address != ""&#41; &#123;
$headers .= "From&#58; $from_address\r\n";
&#125;

// CHECK FOR CC OR BCC
if&#40;$incoming_mailto_cc != ""&#41; &#123;
$headers .= "Cc&#58; $incoming_mailto_cc\r\n";
&#125;
if&#40;$incoming_mailto_bcc != ""&#41; &#123;
$headers .= "Bcc&#58; $incoming_mailto_bcc\r\n";
&#125;

// SEND EMAIL
mail&#40;$incoming_mailto, $incoming_subject, $message, $headers&#41;;

// SEND AUTO-RESPONSE IF ACTIVATED
if&#40;$autorespond_on == "yes"&#41; &#123;
$autorespond_mailto = @$HTTP_POST_VARS&#91;$autorespond_mailto_field&#93;;
$autorespond_headers = "From&#58; $autorespond_from";
mail&#40;$autorespond_mailto, $autorespond_subject, $autorespond_contents, $autorespond_headers&#41;;
&#125;

// FORWARD TO THANK YOU PAGE
header&#40;"Location&#58; $incoming_thanks"&#41;; 


?>



Forma
--------------------------


 <p align="center"> 
                    <input name="incoming_mailto" type="hidden" value='info@news.gr'>
                    <input type='hidden' name='rec_subject' value='domain ακροατή'>
                    <input type='hidden' name='rec_thanks' value='http&#58;//www.domain.gr/thanks.html'>
                    <font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><br>
                    <strong>Όνομα/Name&#58;</strong><font color="#000066"><br>
                    <input type="text" name="ONOMA" style="border-top-width &#58; 1px;border-right-width &#58; 1px;border-bottom-width &#58; 1px;border-left-width &#58; 1px;border-color &#58; blue blue blue blue;">
                    <br>
                    <br>
                    <strong><font color="#FFFFFF">marka&#58;</font><br>
                    <input type="text" name="EPONYMO" style="border-top-width &#58; 1px;border-right-width &#58; 1px;border-bottom-width &#58; 1px;border-left-width &#58; 1px;border-color &#58; blue blue blue blue;">
                    <br>
                    <br>
                    <font color="#FFFFFF">nea&#58;</font><br>
                    <input type="text" name="POLI" style="border-top-width &#58; 1px;border-right-width &#58; 1px;border-bottom-width &#58; 1px;border-left-width &#58; 1px;border-color &#58; blue blue blue blue;">
                    <br>
                    <br>
                    <font color="#FFFFFF">Πόλη/City&#58;</font><br>
                    <input type="text" name="POLI" style="border-top-width &#58; 1px;border-right-width &#58; 1px;border-bottom-width &#58; 1px;border-left-width &#58; 1px;border-color &#58; blue blue blue blue;">
                    <br>
                    <br>
                    <font color="#FFFFFF">E-mail</font><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif">&#58;</font></strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong><br>
                    <input type="text" name="EMAIL" style="border-top-width &#58; 1px;border-right-width &#58; 1px;border-bottom-width &#58; 1px;border-left-width &#58; 1px;border-color &#58; blue blue blue blue;">
                    </strong></font></font></font></p>
                  <p align="center"><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong><br>
                    Το μήνυμά σας/Message&#58;</strong><br>
                    <textarea name="MHNYMA" rows="5" cols="50" style="border-top-width &#58; 1px;border-right-width &#58; 1px;border-bottom-width &#58; 1px;border-left-width &#58; 1px;border-color &#58; blue blue blue blue;"></textarea>
                    <br>
                    </font></p>
                  <center>
                    <font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"> 
                    <input name="submit2" type="submit" style="font-size &#58; 10px;font-family &#58; Verdana;font-weight &#58; bold;color &#58; navy;background-color &#58; white;" value="Send">
                    <font color="#336699">&amp; &amp;</font> 
                    <input name="submit22" type="reset" style="font-size &#58; 10px;font-family &#58; Verdana;font-weight &#58; bold;color &#58; navy;background-color &#58; white;" value="Clear">
                    </font> 
                   
                  </center>

Απάντηση

Επιστροφή στο “PHP έτοιμες εφαρμογές”

Μέλη σε σύνδεση

Μέλη σε αυτήν τη Δ. Συζήτηση: Δεν υπάρχουν εγγεγραμμένα μέλη και 0 επισκέπτες