+ Reply to Thread
Results 1 to 8 of 8

Thread: Need help with a building a secure form

  1. #1
    justin.scherer14 is offline x10Hosting Member justin.scherer14 is an unknown quantity at this point
    Join Date
    Jun 2010
    Posts
    54

    Need help with a building a secure form

    Hello,

    So I have finished up pretty much everything for my website except the two forms that I need. I need them to be secure and I need them to go straight to my e-mail. If anyone has an idea on how to do this that would be great because, again, this is the last part of my website that needs work.
    New website for anyone to join! Feel good about what you are doing, you never know who may be watching. http://thehelpinghand.co.cc

  2. #2
    froger is offline x10Hosting Member froger is an unknown quantity at this point
    Join Date
    Sep 2009
    Posts
    49

    Re: Need help with a building a secure form

    Use PHP?

    $variable = strip_tags(addslashes($_POST['form']))

    if ($variable != NULL)
    {
    mail('someone@aol.com', 'Title', $variable);
    }

  3. #3
    farscapeone's Avatar
    farscapeone is offline Community Advocate farscapeone is on a distinguished road
    Join Date
    Dec 2008
    Location
    Србија (Serbia)
    Posts
    1,166

    Re: Need help with a building a secure form

    If you want it really secure, you should look at his tutorial:
    http://net.tutsplus.com/tutorials/ph...ith-form-keys/

  4. #4
    justin.scherer14 is offline x10Hosting Member justin.scherer14 is an unknown quantity at this point
    Join Date
    Jun 2010
    Posts
    54

    Re: Need help with a building a secure form

    Thank you for that! I will be using that website to make my forms secure. Can anyone help me with creating a php and html form that will submit the data it gets to me in e-mail form. I have been trying to do this but it keeps sending the form with the nobody@thesite.com e-mail address. This does not work because it creates a problem that sets off spam alerts and filters. It will not even get to my e-mail address. So, if anyone can help me or guide me to a tutorial on how to do this that would be greatly appreciated.
    New website for anyone to join! Feel good about what you are doing, you never know who may be watching. http://thehelpinghand.co.cc

  5. #5
    tillabong is offline x10Hosting Member tillabong is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    60

    Re: Need help with a building a secure form

    Hi, earlier on i created a similar thread with the issue of php mail() getting filtered and going to the junk folder. I didnt manage to get an answer from the thread but after weeks of trying, these few things did the trick.

    1. I created an MX entry for my domain. Just go to your cPanel and create an MX entry for your domain.

    2. Add the proper headers to your php code. Remember to change the email address accordingly. And make sure that the email address actually exist on the server. You could create an email address in you cPanel.
    PHP Code:
    $headers  'From: <admin@yoursite.com>' "\r\n";
    $headers .= '<admin@yoursite.com>' "\r\n";
    $headers .= 'MIME-Version: 1.0' "\r\n";
    $headers .= 'Content-Type: text/html; charset=ISO_8859-1' "\r\n";
    $headers .= 'Content-Transfer-Encoding: 8bit' "\r\n";
    $headers .= 'Return-Path: admin@yoursite.com' "\r\n";
                                                                            
    $mail mail($to$subject$letter$headers"-fadmin@yoursite.com"); 
    3. Under Email Authentication in your cPanel. Enable domainkeys and SPF.

    Hope all these works out for you. =)

  6. #6
    arnab792 is offline x10Hosting Member arnab792 is an unknown quantity at this point
    Join Date
    Oct 2008
    Location
    india
    Posts
    1

    Thumbs up mail function php

    declare the variable 1st....
    add your email to $tomail
    <?php
    $fname=$_POST['fname'];
    $email=$_POST['email'];
    $phone=$_POST['phone'];
    $address=$_POST['address'];
    $message=$_POST['message'];
    $mailsubj = "Email Confirmation";
    $sender = $email;
    $tomail= "yourname@example.com";
    $strBody="<html><body>Thank you for contacting us.<br />Your E-mail has been submitted. We will soon you contact.<br><br>Following are full details:<br><br>";
    $strBody.="<b>Name:</b> $fname <br />"."<b>Email:</b> $email <br />"."<b>Phone:</b> $phone <br />"."<b>Address:</b> $address <br />"."<b>Message:</b> $message <br />";
    $strBody.="</body></html>";

    mail($tomail, $mailsubj, $strBody, "From: $sender\nContent-Type: text/html; charset=iso-8859-1");

    ?>

  7. #7
    tillabong is offline x10Hosting Member tillabong is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    60

    Re: mail function php

    Quote Originally Posted by arnab792 View Post
    $fname=$_POST['fname'];
    $email=$_POST['email'];
    $phone=$_POST['phone'];
    $address=$_POST['address'];
    $message=$_POST['message'];
    $mailsubj = "Email Confirmation";
    $sender = $email;
    $tomail= "yourname@example.com";
    Your variables are subjected to headers injection.

  8. #8
    justin.scherer14 is offline x10Hosting Member justin.scherer14 is an unknown quantity at this point
    Join Date
    Jun 2010
    Posts
    54

    Re: Need help with a building a secure form

    Okay. I will try that and let you know what happens. Right now it seems like the Chopin servers are down so I can not do anything until they are back up. Thank you again for that help. I basically have the php forms all laid out so now it is just getting it to the email address is all.
    New website for anyone to join! Feel good about what you are doing, you never know who may be watching. http://thehelpinghand.co.cc

+ Reply to Thread

Similar Threads

  1. Form building
    By zzakir in forum Tutorials
    Replies: 2
    Last Post: 07-09-2010, 11:25 PM
  2. Secure FTP
    By gustavoc in forum Free Hosting
    Replies: 1
    Last Post: 11-13-2009, 06:39 AM
  3. Building a New PC
    By magfersile in forum Computers & Technology
    Replies: 21
    Last Post: 07-21-2008, 04:15 AM
  4. Need a bit of PC building help.
    By GamingX in forum Computers & Technology
    Replies: 0
    Last Post: 02-12-2008, 08:29 AM
  5. Most Secure
    By trev in forum Off Topic
    Replies: 3
    Last Post: 10-10-2005, 04:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers