Jump to content

2d2f

Members
  • Posts

    14
  • Joined

  • Last visited

Posts posted by 2d2f

  1. With respect, but I am unable to interpret your query.

    Usted habla espanol? Perdoneme porque no era preciso. :)

     

     

    Define "working".

     

    The e-mail check on the contact page does sure work. If you want to actually send data through the internet (or save it anywhere), you will have to tell us what server-side language you are working with (if not php), what your script looks like, where the data will be send / stored, etc.

     

    For now I do not conclude how your forms could possibly work with this current setup.

     

    Yes, I meant to send data trough. The situation is specific because I used wix creator to make the pages and a workaround to get rid of the ads.

  2. Based on the code provided, the phone field isn't being used in the script which processes the form. It needs to be incorporated like you did with the name field.

     

    I tried it like this, and I don't know what I am doing wrong because I am not getting the input from the phone field:

    $name = $_POST['name'];
    $visitor_email = $_POST['email'];
    $phone = $_POST['phone'];
    $text = $_POST['text'];
    
    $email_from = "$visitor_email \r\n";
    $email_subject = "New Form submission ";
    $email_body = "You have received a new message from the user $name.\n".
        "Here is the message:\n $text";
    	"Here is the phone:\n $phone";
    
     <h6 class="phone"> <i class="icon-phone-sign"></i>
            <input type="text" name="phone" id="phone" /> 
          <label for="phone">Phone</label>
        </h6> 
    
  3. I wonder where on earth you got the text/plain from in the first place. Let me guess: w3schools?

     

    This is an incredibly exotic encoding which is explicitly marked as “for humans only”, so you're unlikely to find any language which parses this. In fact, I've never seen it being used in real life (outside of w3schools).

     

    In any case: You need a better learning resource.

    Sorry, this is the first time that I'm dealing with php. I found the code online. Maybe here http://code.tutsplus.com/tutorials/design-a-prettier-web-form-with-css-3--net-9542

  4. <form action="form-to-email.php" method="post" class="form"> 
       
        <p class="name"> <i class="icon-user"></i>
            <input type="text" name="name" id="name" /> 
          <label for="name">Name</label> 
        </p> 
       
        <p class="email"> <i class="icon-envelope"></i><span id="sprytextfield1">
        <input type="text" name="email" id="email" />
        </span>
          <label for="email">E-mail</label> 
        </p> 
       
        <p class="phone"><i class="icon-phone-sign"></i> 
            <input type="text" name="phone" id="phone" /> 
          <label for="web">Phone</label>
        </p> 
       
        <p class="text"><span id="sprytextarea1">
          <textarea name="text"></textarea>
        <span class="textareaRequiredMsg">A value is required.</span></span></p> 
       
        <p class="submit">
          <input type="submit" name="submit" id="submit" value="Send message">
        </p> 
       
    </form>
    
    <?php
    if(!isset($_POST['submit']))
    {
    	//This page should not be accessed directly. Need to submit the form.
    	echo "error; you need to submit the form!";
    }
    $name = $_POST['name'];
    $visitor_email = $_POST['email'];
    $message = $_POST['message'];
    
    if(IsInjected($visitor_email))
    {
        echo "Bad email value!";
        exit;
    }
    
    $email_from = '$visitor_email \r\n"';
    $email_subject = "New Form submission";
    $email_body = "You have received a new message from the user $name.\n".
        "Here is the message:\n $message";
        
    $to = "2d2f@gmail.com";//<== update the email address
    $headers = "From: $email_from \r\n";
    $headers .= "Reply-To: $visitor_email \r\n";
    //Send the email!
    mail($to,$email_subject,$email_body,$headers);
    //done. redirect to thank-you page.
    header('Location: thank-you.html');
    

    I think that I have made the suggested changes.

  5.  <form action="form-to-email.php" method="post" enctype="text/plain" class="form"> 
       
        <p class="name"> <i class="icon-user"></i>
            <input type="text" name="name" id="name" /> 
          <label for="name">Name</label> 
        </p> 
       
        <p class="email"> <i class="icon-envelope"></i><span id="sprytextfield1">
        <input type="text" name="email" id="email" />
        </span>
          <label for="email">E-mail</label> 
        </p> 
       
        <p class="phone"><i class="icon-phone-sign"></i> 
            <input type="text" name="phone" id="phone" /> 
          <label for="web">Phone</label>
        </p> 
       
        <p class="text"><span id="sprytextarea1">
          <textarea name="text"></textarea>
        <span class="textareaRequiredMsg">A value is required.</span></span></p> 
       
        <p class="submit">
          <input type="submit" name="submit" id="submit" value="Send message">
        </p> 
       
    </form>
    

    The form is located in index.html and separate page is form-to-email.php. Do I need to link them <link href=>, <link rel=> or the files just need to be in the same folder?

    <?php
    if(!isset($_POST['submit']))
    {
    	//This page should not be accessed directly. Need to submit the form.
    	echo "error; you need to submit the form!";
    }
    $name = $_POST['name'];
    $visitor_email = $_POST['email'];
    $message = $_POST['message'];
    
    //Validate first
    if(empty($name)||empty($visitor_email)) 
    {
        echo "Name and email are mandatory!";
        exit;
    }
    
    if(IsInjected($visitor_email))
    {
        echo "Bad email value!";
        exit;
    }
    
    $email_from = '$visitor_email \r\n"';
    $email_subject = "New Form submission";
    $email_body = "You have received a new message from the user $name.\n".
        "Here is the message:\n $message".
        
    $to = "2d2f@gmail.com";//<== update the email address
    $headers = "From: $email_from \r\n";
    $headers .= "Reply-To: $visitor_email \r\n";
    //Send the email!
    mail($to,$email_subject,$email_body,$headers);
    //done. redirect to thank-you page.
    header('Location: thank-you.html');
    
    
×
×
  • 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.