Jump to content

HTML FORM & CAPTCHA USE


rockaclimba

Recommended Posts

This is HTML FORM

[code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Example</title>
   
  </head>

<div id="map" style="width: 500px; height: 300px">
  <form name="form1" id="form1" method="get" action="http://www.mysite.com/script.php">
    <table width="100%" height="440"  border="1" align="center" cellpadding="5" cellspacing="5" bordercolor="#006699" bgcolor="#EFEFEF">
      <tr bordercolor="#006699" bgcolor="#006699">
        <td height="16" colspan="2"><div align="center"><strong><font color="#FFFFFF" size="2" face="Arial">Fill
            Up All Fields - </font></strong><font color="#FFFFFF" size="2" face="Arial"><strong>Cost
            of package is depends on what you select here.</strong></font><font face="Arial, Helvetica, sans-serif" size="1"><strong><br />
            <font color="#FFFFFF">[<font color="#000000">Note:</font></font></strong></font><font color="#FFFFFF" size="1" face="Arial, Helvetica, sans-serif"><strong>
            We will send you all detail information about Itinerary &amp; Price,
            by e-mail ID you have entered here]</strong></font></div></td>
      </tr>
      <tr bgcolor="#EFEFEF">
        <td height="34" bordercolor="#EFEFEF"><font color="#000000" size="2" face="Verdana,Tahoma,Arial,Helvetica,Sans-serif,sans-serif"><b>Email<font color="#FF0000">
          *</font> </b></font></td>
        <td bordercolor="#EFEFEF"><font color="#000000" size="1" face="Verdana">
          <input name="r_email" type="text" id="r_email" size="25" maxlength="35" />
          </font></td>
      </tr>
      <tr bgcolor="#EFEFEF">
        <td width="39%" height="39" bordercolor="#EFEFEF"><div align="left"><font color="#000000" size="2" face="Verdana"><b>Number
            of adults </b></font><font color="#FF0000" size="2" face="Verdana,Tahoma,Arial,Helvetica,Sans-serif,sans-serif"><b>
            *</b></font></div></td>
        <td width="61%" bordercolor="#EFEFEF"><font color="#000000" size="1" face="Verdana">
          <label>
          <input name="adults" type="text" id="adults" size="10" maxlength="16" />
          <b><font size="-2" face="Verdana,Tahoma,Arial,Helvetica,Sans-serif,sans-serif">Children
          </font></b>
          <input name="kids" type="text" id="kids" size="10" maxlength="15" />
          </label>
          </font></td>
      </tr>
      <tr valign="top" bgcolor="#EFEFEF">
        <td height="40" bordercolor="#EFEFEF"><font color="#000000" size="2" face="Verdana"><b>Tentative
          Travel Start Date </b></font><font color="#FF0000" size="2" face="Verdana,Tahoma,Arial,Helvetica,Sans-serif,sans-serif"><b>
          *</b></font></td>
        <td bordercolor="#EFEFEF"><font color="#000000">
          <label>
          <select id="FormsComboBox15" name="month" style = " font-family:Arial; font-size:8pt;">
            <option value="" selected="selected">Month</option>
            <option value="January">Jan</option>
            <option value="February">Feb</option>
            <option value="March">Mar</option>
            <option value="April">Apr</option>
            <option value="May">May</option>
            <option value="June">Jun</option>
            <option value="July">Jul</option>
            <option value="August">Aug</option>
            <option value="September">Sep</option>
            <option value="October">Oct</option>
            <option value="November">Nov</option>
            <option value="December">Dec</option>
          </select>
          <font size="2" face="Arial, Helvetica, sans-serif">
          <select id="FormsComboBox16" name="date" style = " font-family:Arial; font-size:8pt;">
            <option value="" selected="selected">Date</option>
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
            <option value="5">5</option>
            <option value="6">6</option>
            <option value="7">7</option>
            <option value="8">8</option>
            <option value="9">9</option>
            <option value="10">10</option>
            <option value="11">11</option>
            <option value="12">12</option>
            <option value="13">13</option>
            <option value="14">14</option>
            <option value="15">15</option>
            <option value="16">16</option>
            <option value="17">17</option>
            <option value="18">18</option>
            <option value="19">19</option>
            <option value="20">20</option>
            <option value="21">21</option>
            <option value="22">22</option>
            <option value="23">23</option>
            <option value="24">24</option>
            <option value="25">25</option>
            <option value="26">26</option>
            <option value="27">27</option>
            <option value="28">28</option>
            <option value="29">29</option>
            <option value="30">30</option>
            <option value="31">31</option>
          </select>
          <select id="FormsComboBox17" name="year" style = " font-family:Arial; font-size:8pt;">
            <option value="">Year</option>
            <option value="2006">2006</option>
            <option value="2007">2007</option>
          </select>
          </font></label>
          </font></td>
      </tr>
      <tr bgcolor="#EFEFEF">
        <td height="48" valign="top" bordercolor="#EFEFEF"><font color="#000000" size="2" face="Verdana"><strong>Enter
          Name of Trek/Peak/Location</strong></font></td>
        <td valign="top" bordercolor="#EFEFEF"><font color="#000000" size="1" face="Arial">
          <input name="package_name" type="text" id="package_name" size="30" />
          </font></td>
      </tr>
      <tr bgcolor="#EFEFEF">
        <td height="122" valign="top" bordercolor="#EFEFEF"> <p align="left"><font color="#000000" size="2" face="Verdana"><strong>Write
            in max. 10 Lines about your travel plan. </strong></font><font color="#FF0000" size="2" face="Verdana,Tahoma,Arial,Helvetica,Sans-serif,sans-serif"><b>
            *</b></font></p>
          <div align="left">
            <table width="99%"  border="0" align="left" cellpadding="0" cellspacing="0">
              <tr>
                <td><div align="left"><font color="#000000" size="2" face="Verdana">Do
                    mention about special need like medical problems, kids- it
                    will help you in remote himalayas.</font></div></td>
              </tr>
            </table>
          </div>
          <p></p></td>
        <td valign="top" bordercolor="#EFEFEF"><font color="#000000" size="1" face="Verdana">
          <label> </label>
          <textarea name="activity_plan" cols="30" rows="6" id="textarea2"></textarea>
          </font></td>
      </tr>
      <tr align="left" valign="middle" bordercolor="#EFEFEF">
        <td height="21"><strong><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">Airport
          Takeover </font> </strong></td>
        <td height="21"><font color="#000000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Yes
          <input type="radio" name="airport_takeover" value="Airport Takeover Yes "/>
          No
          <input type="radio" name="airport_takeover" value="Airport Takeover  NO"/>
          </strong> </font></td>
      </tr>
      <tr bgcolor="#EFEFEF">
        <td height="32" bordercolor="#EFEFEF"><div align="left"><font color="#000000" size="2" face="Verdana"><strong>Mention
            Your Budget</strong></font><font color="#FF0000" size="2" face="Verdana,Tahoma,Arial,Helvetica,Sans-serif,sans-serif"><b>
            *</b></font></div></td>
        <td bordercolor="#EFEFEF"><font color="#000000" size="1" face="Verdana">
          <label>
          <input name="r_budget" type="text" id="budget2" size="8"/>
          <input type="radio" name="budget" value="USD"/>
          in US $
          <input type="radio" name="budget" value="INR"/>
          in INR</label>
          <input type="radio" name="budget" value="POUND"/>
          in &pound; Pound</font></td>
      </tr>
      <tr bordercolor="#006699" bgcolor="#006699">
        <td height="36" colspan="2"> <div align="center"><font size="1" face="Verdana">
            <label>
            <input type="submit" name="Submit3" value="Submit By Clicking Once "/>
            &nbsp;&nbsp;&nbsp;
            <input type="reset" name="Submit22" value="Reset"/>
            </label>
            </font></div></td>
      </tr>
    </table>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
  </form>
<p>&nbsp;</p></div>
  </body>
</html>[/code]


PLEASE HELP ME-HOW I CAN ADD ANY CODE AND USE CAPTCHA .
Link to comment
Share on other sites

Thanks...where to insert some code in HTM form ?
I am using a php script to send form information to a email ID- what are changes or what script i should use for this?

I mean how many .php scripts will be in use and how?
This is 3rd day- i am understanding with instinct from reading articles....about codes but where to put them and which script has tp be called for sending data to emailis confusing me.

PLEASE HELP !
Link to comment
Share on other sites

I would sincerely recommend finding some tutorials for php on Google and get comfortable with the basics before trying to tackle something like this.

You gotta learn to walk before you can run.

We will be more than happy to help, but you have to know a little something about basic stuff before you can expect us to help with CAPTCHA scripts.

Google is your friend (Sorry, don't know who said this offhand to give proper quote credit.)
Link to comment
Share on other sites

Well... i succeeded in using a script with image verification on main domain but this script is not working on subdomain.

[code]

<?php
session_start();
$from_address = "mymail@yahoo.com";
$required_on = "yes";
$required_errorpage = "error.html";
$number_error = "number_error.html";
$override = "yes";
$incoming_mailto = "rmymail@yahoo.com";
$incoming_subject = "Inquiry Form.";
$incoming_thanks = "thanks.html";
$ban_ip_on = "yes";
$ban_ip_list = "111.222.33.55,11.33.777.99";
$secure_domain_on = "no";
$autorespond_on = "no";
$number  = $_POST['txtNumber'];

$incoming_fields = array_keys($HTTP_POST_VARS);
$incoming_values = array_values($HTTP_POST_VARS);

if($override == "no") {
$incoming_mailto = @$HTTP_POST_VARS['rec_mailto'];
$incoming_subject = @$HTTP_POST_VARS['rec_subject'];
$incoming_thanks = @$HTTP_POST_VARS['rec_thanks'];
}
$incoming_mailto_cc = @$HTTP_POST_VARS['opt_mailto_cc'];
$incoming_mailto_bcc = @$HTTP_POST_VARS['opt_mailto_bcc'];
$form_url = @$HTTP_REFERER;
if($secure_domain_on == "yes") {
$form_url_array = parse_url($form_url);
$form_domain = $form_url_array[host];
if($form_domain != $HTTP_SERVER_VARS[HTTP_HOST]) {
echo "<h2>Form Error - Invalid Domain</h2>
You have accessed this Form from an external domain - this is not allowed.<br>
You may only submit forms from a file that exists on the same domain name.<br>
If you believe to be receiving this message in error, please write to webmaster@mysite.com
<br><br>";
$error = "yes";
}
}
if($incoming_mailto == "") {
echo "<h2>Form 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:<br>
&#060;input type=\"hidden\" name=\"rec_mailto\" value=\"mymail@yahoo.com\"&#062;
<br><br>
If you are still confused, please write to webmaster@mysite.com<br><br><br><br>
";
$error = "yes";
}
if($incoming_subject == "") {
echo "<h2>Form 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:<br>
&#060;input type=\"hidden\" name=\"rec_subject\" value=\"New Form Email\"&#062;
<br><br>
If you are still confused, please write to support@mysite.com<br><br><br><br>
";
$error = "yes";
}
// CHECK IF THANKS IS SET
if($incoming_thanks == "") {
echo "<h2>Form 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:<br>
&#060;input type=\"hidden\" name=\"rec_thanks\" value=\"thanks.html\"&#062;
<br><br>
please write to myemail@yahoo.com<br><br><br><br>
";
$error = "yes";
}
// CHECK IF IP ADDRESS IS BANNED
if($ban_ip_on == "yes") {
if(strstr($ban_ip_list, $HTTP_SERVER_VARS[REMOTE_ADDR])) {
echo "<h2>Form Error - Banned IP</h2>
You cannot use this form because your IP address has been banned by the administrator.<br>
";
$error = "yes";
}
}
if($error == "yes") {
exit();
}
// SET EMAIL INTRODUCTION
$message = "This email was received from Form located at $form_url \n\n";
// LOAD EMAIL CONTENTS
for ($i = 0; $i < count($incoming_fields); $i++) {
if($incoming_fields[$i] != "rec_mailto") {
if($incoming_fields[$i] != "rec_subject") {
if($incoming_fields[$i] != "rec_thanks") {
if($incoming_fields[$i] != "opt_mailto_cc") {
if($incoming_fields[$i] != "opt_mailto_bcc") {

// CHECK FOR REQUIRED FIELDS IF ACTIVATED
if($required_on == "yes") {
$sub = substr($incoming_fields[$i], 0, 2);
if($sub == "r_") {
if($incoming_values[$i] == "" OR !isset($incoming_values[$i]) OR $incoming_values[$i] == " ") {
header("Location: $required_errorpage");
exit();
}}}
if (md5($number) == $_SESSION['image_random_value']) {
$_SESSION['image_is_logged_in'] = true;
// remove the random value from session
$_SESSION['image_random_value'] = '';
header("Location: $incoming_thanks");
exit;
} else {
header("Location: $number_error");
}

// ADD FIELD TO OUTGOING MESSAGE
$message .= "$incoming_fields[$i]:\n$incoming_values[$i]\n\n";
}}}}}}
// SET EMAIL FOOTER
$message .= "\n\nThanks for visiting us.\n.\n\n";
// CLEAR HEADERS
$headers = "";
// ADD FROM ADDRESS
if($from_address != "") {
$headers .= "From: $from_address\r\n";
}
// CHECK FOR CC OR BCC
if($incoming_mailto_cc != "") {
$headers .= "Cc: $incoming_mailto_cc\r\n";
}
if($incoming_mailto_bcc != "") {
$headers .= "Bcc: $incoming_mailto_bcc\r\n";
}
// SEND EMAIL
mail($incoming_mailto, $incoming_subject, $message, $headers);

?>[/code]

Kndky help in making this script..

1.Workable on subdomains
2. If possible more secure with sessions and IP's
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.