14 replies
  • WEB DESIGN
  • |
Hey guys,

I am trying to make a website with Artisteer however, I want to add a form. The form needs to gather a name, email and a message then Email me with the results when the user hits Submit. Furthermore, a confirmation message needs to appear when the submission is made. Atristeer does not support forms however, the source HTML of particular sections of each page can be edited.
Is it possible for someone to make the form using HTML so I can simple copy and paste it into the website?
#artisteer #form #html #make
  • Profile picture of the author magiclouie
    Originally Posted by pagunston View Post

    Hey guys,

    I am trying to make a website with Artisteer however, I want to add a form. The form needs to gather a name, email and a message then Email me with the results when the user hits Submit. Furthermore, a confirmation message needs to appear when the submission is made. Atristeer does not support forms however, the source HTML of particular sections of each page can be edited.
    Is it possible for someone to make the form using HTML so I can simple copy and paste it into the website?
    You can create good looking forms using aweber and you can get the html codes of the forms.

    I have tried wufoo too and it can provide you with the codes of the form.

    I hope that helps.
    {{ DiscussionBoard.errors[4950726].message }}
    • Profile picture of the author Ajay Tiwari
      Here is the code:

      For Form:
      <form name="contactform" method="post" action="sendmail.php">
      <table width="450px">
      </tr>
      <tr>
      <td valign="top">
      <label for="first_name">First Name *</label>
      </td>
      <td valign="top">
      <input type="text" name="first_name" maxlength="50" size="30">
      </td>
      </tr>

      <tr>
      <td valign="top"">
      <label for="last_name">Last Name *</label>
      </td>
      <td valign="top">
      <input type="text" name="last_name" maxlength="50" size="30">
      </td>
      </tr>
      <tr>
      <td valign="top">
      <label for="email">Email Address *</label>
      </td>
      <td valign="top">
      <input type="text" name="email" maxlength="80" size="30">
      </td>

      </tr>
      <tr>
      <td valign="top">
      <label for="telephone">Telephone Number</label>
      </td>
      <td valign="top">
      <input type="text" name="telephone" maxlength="30" size="30">
      </td>
      </tr>
      <tr>
      <td valign="top">
      <label for="comments">Comments *</label>
      </td>
      <td valign="top">
      <textarea name="comments" maxlength="1000" cols="25" rows="6"></textarea>
      </td>

      </tr>
      <tr>
      <td colspan="2" style="text-align:center">
      <input type="submit" value="Submit" name="submit">
      </td>
      </tr>
      </table>
      </form>



      Save following as a sendmail.php in the same folder

      <?php
      if(isset($_POST['email'])) {

      // EDIT THE 2 LINES BELOW AS REQUIRED
      $email_to = "you@yourdomain.com";
      $email_subject = "Your email subject line";


      function died($error) {
      // your error code can go here
      echo "We are very sorry, but there were error(s) found with the form you submitted. ";
      echo "These errors appear below.<br /><br />";
      echo $error."<br /><br />";
      echo "Please go back and fix these errors.<br /><br />";
      die();
      }

      // validation expected data exists
      if(!isset($_POST['first_name']) ||
      !isset($_POST['last_name']) ||
      !isset($_POST['email']) ||
      !isset($_POST['telephone']) ||
      !isset($_POST['comments'])) {
      died('We are sorry, but there appears to be a problem with the form you submitted.');
      }

      $first_name = $_POST['first_name']; // required
      $last_name = $_POST['last_name']; // required
      $email_from = $_POST['email']; // required
      $telephone = $_POST['telephone']; // not required
      $comments = $_POST['comments']; // required

      $error_message = "";
      $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
      if(!preg_match($email_exp,$email_from)) {
      $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
      }
      $string_exp = "/^[A-Za-z .'-]+$/";
      if(!preg_match($string_exp,$first_name)) {
      $error_message .= 'The First Name you entered does not appear to be valid.<br />';
      }
      if(!preg_match($string_exp,$last_name)) {
      $error_message .= 'The Last Name you entered does not appear to be valid.<br />';
      }
      if(strlen($comments) < 2) {
      $error_message .= 'The Comments you entered do not appear to be valid.<br />';
      }
      if(strlen($error_message) > 0) {
      died($error_message);
      }
      $email_message = "Form details below.\n\n";

      function clean_string($string) {
      $bad = array("content-type","bcc:","to:","cc:","href");
      return str_replace($bad,"",$string);
      }

      $email_message .= "First Name: ".clean_string($first_name)."\n";
      $email_message .= "Last Name: ".clean_string($last_name)."\n";
      $email_message .= "Email: ".clean_string($email_from)."\n";
      $email_message .= "Telephone: ".clean_string($telephone)."\n";
      $email_message .= "Comments: ".clean_string($comments)."\n";


      // create email headers
      $headers = 'From: '.$email_from."\r\n".
      'Reply-To: '.$email_from."\r\n" .
      'X-Mailer: PHP/' . phpversion();
      @mail($email_to, $email_subject, $email_message, $headers);
      ?>

      <!-- include your own success html here -->

      Thank you for contacting us. We will be in touch with you very soon.

      <?php
      }
      ?>



      Above at you@yourdomain.com put your email address where you want to receive submitted details by visitor and at Your email subject line put subject line like Feedback or Visitor Query Etc.
      {{ DiscussionBoard.errors[4950845].message }}
  • Profile picture of the author hanakuza
    Thanks for the share, will give this one a try. Is this a secure form code- safe from hackers?
    {{ DiscussionBoard.errors[4951228].message }}
  • Profile picture of the author Ajay Tiwari
    It is a simplest contact us form code.. many peoples know this.. i have used above code for my sites and never faced any hacking sort of issue so i believe it is secure..
    {{ DiscussionBoard.errors[4951520].message }}
  • {{ DiscussionBoard.errors[4960082].message }}
  • Profile picture of the author mikeavery10
    Thanks to ajaykt,

    Its really helpful and working. The code is simple and effective. We can customized it to our requirement.
    {{ DiscussionBoard.errors[4960144].message }}
  • Profile picture of the author johnny125
    Since I like to work with ASP, maybe someone of you would like to use the ASP.NET and VB version of forms.

    form.html:

    Code:
    <html>
     <head>
     <title>form to email script</title>
     </head>
     <body> 
    
    <div align="center">
     <form method="POST" action="form_ac.asp" name="form1">
     <table width="75%" border="0" cellspacing="0" cellpadding="0">
     <tr> 
     <td>name:</td>
     <td colspan="2"> 
     <input type="text" name="name">
     </td>
     </tr>
     <tr> 
     <td>email:</td>
     <td colspan="2"> 
     <input type="text" name="email">
     </td>
     </tr>
     <tr> 
     <td>message:</td>
     <td colspan="2"> 
     <textarea name="message" cols="40" rows="5"></textarea>
     </td>
     </tr>
     <tr>
     <td>&nbsp;</td>
     <td colspan="2">
     <input type="submit" name="Submit" value="Submit">
     <input type="reset" name="Reset" value="Reset">
     </td>
     </tr>
     </table>
     </form>
     </div>
     </body>
     </html>

    form_ac.asp (the ac is short for acquire as it will be receiving values):

    Code:
    <%@ Language="VBscript" %>
     <% Option Explicit %>
    
     <html>
     <head>
     <title>Message Sent</title>
     </head>
    
     <body>
     <%
    'declare the variables that will receive the values 
    'receive the values sent from the form and assign them to variables
    'note that request.form("name") will receive the value entered into the textfield
    'called name, and so with email and message
     Dim name, email, message, NewMailObj
     name=request.form("name")
     email=request.form("email")
     message=request.form("message")
    
    'create the mail object and send the details
     Set NewMailObj=Server.CreateObject("CDONTS.NewMail")
     NewMailObj.From = "michael@codefixer.com"
     NewMailObj.To = "whoever_you_want_to_send_it_to@hotmail.com"
     NewMailObj.Subject = "New message sent.." 
     NewMailObj.Body = "the name you entered was " & name & _
     "<br>the email was " & email & _
     "<br>the message was " & message
    
    'you need to add the following lines FOR the mail to be sent in HTML format
     NewMailObj.BodyFormat = 0 
     NewMailObj.MailFormat = 0 
     NewMailObj.Send
    'Close the email object and free up resources 
     Set NewMailObj = nothing
     Response.write "The email was sent."
     %> 
    
     </body>
     </html>
    This code I have found some time ago on some tutorial pages, but it is working for me smooth on many pages
    {{ DiscussionBoard.errors[4960325].message }}
  • Profile picture of the author Jonas B
    with css you can.. use opacity
    Signature
    Proud owner of the most flexible mobile app builder. Check it out at http://bit.ly/hybrica!
    Mobile Web Expert & Android Developer
    {{ DiscussionBoard.errors[4960510].message }}
  • Profile picture of the author pfreelancer
    If you are looking for a hosted form, Aweber is what I use.
    {{ DiscussionBoard.errors[4971700].message }}
  • Profile picture of the author jumpa
    You can use www [dot] freecontactform.com/free.php also
    {{ DiscussionBoard.errors[5043658].message }}
  • Profile picture of the author kenn1288
    great information
    {{ DiscussionBoard.errors[5045060].message }}

Trending Topics