PHP Form Filtering

Hey Guys,
I'm curious as to some of the best solutions to help filter out spamming through a php form.  Should I add captcha?  Is there another way?  I want to be able to filter out the erroneous requests or advertising of selling email lists from the real customers trying to fill out the form.
Thanks for the help!

That's what I was more or less looking for; options.  I looked at recaptcha.net and that seems like a viable option.  I don't mind if users have to enter captcha characters.  I'm assuming that filter class is a way to do it without captcha characters.  It sounds like it's mainly coding on the server side that I would have to implement?

Similar Messages

  • Need help with PHP form with checkboxes, radio buttons and file attachment

    Hi guys,
    I'm having a nightmare with this PHP form where a user can fill it in, attach a doc/pdf and submit. After trying to sort it out with previous code I've used, I've stripped it out and think I should just start again in the hope you geniuses can help!
    Here is the HTML of contact.php:
    <form action="" method="post" name="contact" id="contact">
        <p>Job Title:*<br />
        <input name="position" type="text" /></p>
        <p>Nationality:*<br />
        <select name="nationality">
          <option value="">-- select one --</option>
          <option value="Afghan">Afghan</option>
          <option value="Albanian">Albanian</option>
          <option value="Algerian">Algerian</option>
          <option value="Zambian">Zambian</option>
          <option value="Zimbabwean">Zimbabwean</option>
        </select>
        </p>
        <p>Which country are you currently living in?*<br />
        <select name="country">
        <option value="">-- select one --</option>
        <option value="United Kingdom">United Kingdom</option>
        <option value="Afghanistan">Afghanistan</option>
        <option value="Africa">Africa</option>
        <option value="Zambia">Zambia</option>
        <option value="Zimbabwe">Zimbabwe</option>
        </select>
        </p>
        <label class="radio" for="checkRight">Yes/No question?</label><br />
        <input class="radio" type="radio" name="right" value="Yes" /> Yes
        <input class="radio" type="radio" name="right" value="No" /> No
        <input class="radio" type="radio" name="right" value="N/A" /> Not applicable
        <p>Yes/No question?<br />
        <select name="continue">
        <option value="">-- select one --</option>
        <option value="Yes">Yes</option>
        <option value="No">No</option>
        </select>
        </p>
        <p>Select your resorts:<br />
        Resort 1<input name="res1" type="checkbox" value="Resort 1" />
        Resort 2<input name="res2" type="checkbox" value="Resort 2" />
        Resort 3<input name="res3" type="checkbox" value="Resort 3" />
        Resort 4<input name="res4" type="checkbox" value="Resort 4" />
        Resort 5<input name="res5" type="checkbox" value="Resort 5" />
        Resort 6<input name="res6" type="checkbox" value="Resort 6" />   
        </p>
        <p>Don't send form unless this is checked:* <input type="checkbox" name="parttime" value="Yes" /></p>
        <p>Date of arrival: <input name="arrive" id="datepick" /><br />
        Date of departure: <input name="depart" id="datepick2" /></p>
        <script type="text/javascript" src="assets/scripts/datepickr/datepickr.js"></script>
        <link href="assets/scripts/datepickr/datepickr.css" rel="stylesheet">
        <script type="text/javascript">
        new datepickr('datepick');
        new datepickr('datepick2', {
        </script>
        <p>Name:*<br />
        <input name="name" type="text" /></p>
        <p>E-mail:*<br />
        <input name="email" type="text" /></p>
        <p>Telephone:*<br />
        <input name="telephone" type="text" class="ctextField" /></p>
        <p>Upload CV (Word of PDF formats only):<br />
        <input type="file" name="cv" class="textfield"></p>
        <p><input name="submit" value="Submit Enquiry" class="submitButton" type="submit" /><div style="visibility:hidden; width:1px; height:1px"><input name="url" type="text" size="45" id="url" /></div></p>
    </form>
    By the way, the date boxes work so excuse the Javascript in there!
    To prevent SPAM I've used a trick where there's a hidden URL field which must be left blank for the form to submit which you can see in the PHP.
    Below is where I'm at with the PHP which is placed above the header of contact.php...
    <?php
    if (array_key_exists('submit', $_POST)) {
        $position = $_POST['position'];
        $arrive = $_POST['arrive'];
        $nationality = $_POST['nationality'];
        $parttime = $_POST['parttime'];
        $depart = $_POST['depart'];
        $name = $_POST['name'];
        $email = $_POST['email'];
        $telephone = $_POST['telephone'];
    $to = "[email protected]";
    $subject = "Recruitment Application";
    $message = $headers;
    $message .= "Name: " . $_POST["name"] . "\r\n";
    $message .= "E-mail: " . $_POST["email"] . "\r\n";
    $headers  = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
    $headers .= 'From: My Website <[email protected]>' . "\r\n";
    $message= "
    $url = stripslashes($_POST["url"]);
    if (!empty($url)) {
    header( 'Location: http://www.go-away-spam-robots.com' );
    exit();
    if (!isset($warning)) {
    mail($to, $subject, $message, $headers);
    header( 'Location: http://www.mywebsite.co.uk/sent.php' );
    ?>
    I would like to make pretty much all the field compulsory so if a field is left empty (other than the hidden URL field), a warning message is displayed next to that field.
    Also I would like the file upload field to attach to the email that is sent to me and have the results come through to me in a table format.
    Can anyone help me get my form working?
    Thank you and I hope to hear from you!
    SM

    Hi Nancy,
    Great stuff, thank you for the reply.
    I've managed to get the Formm@iler working and running as I need it to.
    The only thing I'm struggling with is when the user clicks submit, they are taken to a page of whatever results the form returned but it is just a white background with Times New Roman text.
    How can I have it so the user is taken to the form results in the websites' page layout?
    I tried sending them to a generic 'thank you' page by adding the following code but it just took them there whatever the results of the form so that's no good...! I have a feeling it's a bit more complicated than that...
    header( 'Location: http://www.nofussbus.co.uk/test/sent.php' );
    Thank you for your help!

  • PHP form layout issue

    Hi all, I have a basic php form on a page, it works great,
    and my email recieves the content as required, BUT, when the form
    submits and the page shows the forms content, it throws out my
    layout ocmpletely. My white maincontent dissapears, and the footer
    div is all misaligned, my code is attached. Can anyone help please?
    many thanks

    On Thu, 7 Feb 2008 16:34:22 +0000 (UTC), "simbull"
    <[email protected]> wrote:
    >Thanks for the response gary, I have tried that (and just
    did again), that
    >means the user is not presented with the php output,
    which I do want them to be
    >ideally. Anyhow, that aside, it still throws my layout
    out..?
    Impossible to give you a better answer without knowing what
    you want to
    accomplish, but it sounds like your layout might be too
    fragile.
    Gary

  • Need to add senders email address into the subject header of my PHP form (somehow)

    Hello one and all,
    I have a PHP form which is working fine and sends our support team an email with the subject header 'Support'.
    I have been asked to fix this form to include the senders email address into the Subject header so that the support team can filter them easier and reply quicker.
    Any help would be very much appreciated indeed. The form code is below, let me know if you need the whole page.
    Thanks in advance,
    Bradley
    My current form PHP part looks like this: (and the HTML part is below in blue)
    <?php
        if($_GET["action"] == "email")
            $msg = "The following person need support:\n\n";
            $msg = $msg . "First Name: " . $_POST["FirstName"] . " " . $_POST["LastName"] . "\n";
            $msg = $msg . "Tel: " . $_POST["Tel"] . "\n";
            $msg = $msg . "Email: " . $_POST["FROM"] . "\n";
            $msg = $msg . "Support: " . $_POST["Support"] . "\n";
            $msg = $msg . "Model: " . $_POST["Model"] . "\n";
            $msg = $msg . "Comments: " . $_POST["Comments"] . "\n";
            $to ="[email protected]";
            $subject = "Support";
            $from = "From: " . $_POST["FROM"];
            mail($to, $subject, $msg, $emailFrom, $from);
            header("Location:support2.php");
    ?>
    and the HTML part of the fom is like this:
    <form id="form1" name="form1" method="post" action="support.php?action=email">
      <table width="700" border="0" cellspacing="10" cellpadding="10">
        <tr>
          <td valign="middle" class="formtext">*First name:</td>
          <td width="455" valign="middle"><label>
            <input name="FirstName" type="text" class="form-textbox" id="FirstName" />
          </label></td>
        </tr>
        <tr>
          <td valign="middle" class="formtext">*Last name:</td>
          <td valign="middle"><input name="LastName" type="text" class="form-textbox" id="LastName" /></td>
        </tr>
        <tr>
          <td valign="middle" class="formtext">*Email:</td>
          <td valign="middle"><input name="FROM" type="text" class="form-textbox" id="FROM" /></td>
        </tr>
        <tr>
          <td valign="middle" class="formtext">*Telephone:</td>
          <td valign="middle"><input name="Tel" type="text" class="form-textbox" id="Tel" /></td>
        </tr>
        <tr>
          <td valign="middle" class="formtext"> </td>
          <td valign="middle"> </td>
        </tr>
        <tr>
          <td valign="middle" class="formtext">*Support required:</td>
          <td valign="middle"><label>
            <select name="Support" class="form-dropdown" id="Support">
              <option selected="selected">Please select...</option>
              <option value="Connection Issues">Connection Issues</option>
              <option value="Technical Issues">Technical Issues</option>
              <option value="Furniture Faults">Furniture Faults</option>
              <option value="Other">Other</option>
            </select>
          </label></td>
        </tr>
        <tr>
          <td valign="middle" class="formtext">Chair model:</td>
          <td valign="middle"><input name="Model" type="text" class="form-textbox" id="Model" /></td>
        </tr>
        <tr>
          <td valign="middle" class="formtext">*Please describe your issue:</td>
          <td valign="middle"><textarea name="Comments" rows="5" class="form-textarea" id="Comments"></textarea></td>
        </tr>
        <tr>
          <td valign="middle" class="maintext"> </td>
          <td valign="middle" class="maintext"></td>
        </tr>
        <tr>
          <td valign="middle"> </td>
          <td valign="middle"><label>
            <input name="Submit" type="submit" class="form-submit-button" value="Submit" />
          </label></td>
        </tr>
      </table>
      </form>

    MurraySummers you sir, are an absolute legend! This worked perfect straight off the bat!
    I really apreciate your lightning fast reply!
    Thanks again.
    Bradley

  • Online php form (inserts) in pdf form and send via email

    So first hello all.
    There are 4 PDF Forms amd 4 php forms on a website.
    The user should be able to fill out the php form, click on send and the inserts from the user should be stored in the pdf form and send to an email adress.
    I know that there are 3rd party tools, the convert it to a image, draw the inserts and convert it back.
    But i want to know, how to do it with acrobat itself.
    Is there any way to put varaibles in the pdf where php can set (fill)
    If this is impossible:
    I have heard, that there is a server version from acrobat who can manage this.
    The information about this is rarly like i dont understand how much the costs are.
    First : price x (for the server software itself)   
    Second: price y (for every processed document)
    Many thanks in advance
    IT Technik Schiedt

    You cannot use Acrobat on a server in that manner. Acrobat is licensed for one user one system at a time.
    You can create and FDF file with the form field data and use that data to fill-in a PDF. You needd to create a unique PDF that could be added to an email and then deleted. You could also accumulate the data in a database.

  • Can you auto-attach files in a PHP form?

    Hi there,
    Have been looking over everywhere for a solution to my problem. I am going to try and be as clear as I can about the problem.
    I have had some experience making simple PHP forms that let the user put their name, email, subject and body text and send it in an email using the form.
    But for a project I am currently undertaking - the client has requested a form that will pre-attach a particular document to the email when it is sent. All the user has to do is input the email address of the adressee and their name/email address and all the other fields are custom made (i.e. subject, body text) - and the email will be sent to the selected recepient with the file already attached.
    I was envisaging the PHP script would collect the reference for a file that is already sitting on the web server and attach it in the function.
    Is there anyway to do this? Because if it isn't I may as well tell the client to go and use outlook - because the web form will really have no purpose.
    Thanks in advance

    Hi have proceeded along the path of inserting links
    into PHP generated email but I am having trouble in outputting the body message in HTML - All I get out
    in the output email is the HTML tags with the text (plain text).
    Did some research and found out that I have to determine the content type/charset.
    I have tried to do this in my PHP but to no avail. Also I am not getting the email or name of the sender in the email that is generated....
    Anyway, there is the PHP code (and it's not that tight but it works):
    AND SOME DEFAULT TEXT THAT WILL CONTAIN LINKS TO NECESSARY FILES TO DOWNLOAD:
    link to PDF '.$field_message; $headers = 'From: '.$cf_yremail."\r\n"; $headers .= 'Reply-To: '.$cf_yremail."\r\n"; /* If your e-mail is not valid show error message */ if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $mail_to)) { ?>
    Any help on this would be much appreciated....
    Thanks

  • Code issue in php form - submit button not sending email

    Created a form that was originally supposed to open up to 2 pages depending on what was clicked. Clear would send you to an error page, and submit would send you to a thank you page. Decided that was a waste and so did not create the html pages. BUT, wanted the form info for the contact page.
    Here is the issue: it will not submit when submit is clicked. It clears when you click clear, but there's no email coming from the site via submit.
    Do I need to edit the php form code if I don't want the other pages? I've looked at what I have but I don't see if there is a form error or anything here. Here is the code for anyone who wants to have a look. Thanks in advance.
    <?php
    // get posted data into local variables
    $EmailFrom = "EMAIL FROM WEP PAGE - CONTACT - ";
    $EmailTo = "[email protected]";
    $Subject = "EMAIL FROM jennylowhar.com - CONTACT -";
    $name = Trim(stripslashes($_POST['name']));
    $telephone = Trim(stripslashes($_POST['telephone']));
    $email = Trim(stripslashes($_POST['email']));
    $comments = Trim(stripslashes($_POST['comments']));
    // validation
    $validationOK=true;
    if (Trim($name)=="") $validationOK=false;
    if (Trim($email)=="") $validationOK=false;
    if (!$validationOK) {
      print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";
      exit;
    // prepare email body text
    $Body = "";
    $Body .= "name: ";
    $Body .= $name;
    $Body .= "\n";
    $Body .= "telephone: ";
    $Body .= $telephone;
    $Body .= "\n";
    $Body .= "email: ";
    $Body .= $email;
    $Body .= "\n";
    $Body .= "comments: ";
    $Body .= $comments;
    $Body .= "\n";
    // send email
    $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
    // redirect to success page
    if ($success){
      print "<meta http-equiv=\"refresh\" content=\"0;URL=thankyou.html\">";
    else{
      print "<meta http-equiv=\"refresh\" content=\"0;URL=error.php\">";
    ?>

    I'm confused by that, but I know this works.
    $fname=STRIPSLASHES($_POST['fname']);
    $lname=STRIPSLASHES($_POST['lname']);
    $title=STRIPSLASHES($_POST['title']);
    $company=STRIPSLASHES($_POST['company']);
    $street=STRIPSLASHES($_POST['street']);
    $town=STRIPSLASHES($_POST['town']);
    $zip=STRIPSLASHES($_POST['zip']);
    $phone=STRIPSLASHES($_POST['phone']);
    $fax=STRIPSLASHES($_POST['fax']);
    $county=STRIPSLASHES($_POST['county']);
    $phone=STRIPSLASHES($_POST['phone']);
    $email=STRIPSLASHES($_POST['email']);
    $comments=STRIPSLASHES($_POST['comments']);
    $date=STRIPSLASHES($_POST['date']);
    $time=STRIPSLASHES($_POST['time']);
    $location=STRIPSLASHES($_POST['location']);
    $from="$email";
    $to="putemailhere";
    $subject="Submission from Contact Form";
    $msg= "This is a submission from yoururl.com.\n\n"
    . "Clients Name: $fname . $lname \n"
    . "Title: $title\n"
    . "Company Name: $company\n"
    . "Street Address: $street\n"
    . "Town:$town\n"
    . "Zip: $zip\n"
    . "Telephone: $phone\n"
    . "Email Address: $email\n"
    . "Comments: $comments\n";
    mail($to, $subject, $msg, 'From:' .$from);
    PS, go back and edit your origial post and REMOVE your email.
    Gary

  • Php form problem and question

    I am a new web designer who is not code savey yet. Anyway
    during the various sites i have designed i have used 3 different
    forms that process and email it to me using a seperate php form, 1
    in flash, 2 from a standard html form on a windows server. All have
    been uploaded, to the site, tested and worked fine. 2 are in old
    sites, one in my current site. Recently all 3 forms stopped working
    and while they looked like they worked fine they no longer actually
    sent anything. I had a big email arguement with my host and finally
    they added this line into my php script "ini_set
    ("sendmail_from","[email protected]");" email address is example here
    and they added another form to my site called "php4-cgi-fcgi.ini."
    Then my curent form started working again. I haven't changed
    anything, and of course the host never informed me of any changes.
    So why did this need to be added for my form to work again? Does
    this mean they upgraded to another version or something? Ihad a big
    arguement with them because they refused to tell me what they did
    that stopped all my forms from working, they kept acting like it
    was me or my provider that caused the problem, when i am positive
    we were not the problem. Any thoughts?

    doing a google on "ini_set ("sendmail_from" gives a lot of
    info.
    summary- the form script you are using is probably not
    setting a default
    "FROM" email address, so the host has phpmail() reject it as
    possible spam
    abuse.
    The .ini files the host added to your site correct the
    problem. They change
    values for php to use within your hosting domain.
    What php script are you using to send the emails? It is
    probably out of date
    if it doesn't address this issue.
    Off Topic: suggest never arguing with hosting support. Even
    it the person at
    the other end of the phone is an 18 year old drone not
    earning their salt.
    Move the site if needed. Develop social engineering skills to
    get things
    done.
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • Php form for unix server

    Hellow to everybody i would like to know, witch files or
    carpets do i need
    to have
    on a server unix to run a php form (method post, get).
    I mean if a need to create a carpet example "cgi-bin", or if
    a need
    any archive similar "formail.pl" or what else,
    thanks to anyone who can help me.
    David

    Have you ever work with a data-driven website in the past? If
    so, what is specific data-driven app did you work with?
    To get PHP working on your local machine, you need to install
    PHP, MySQL and Apache web server all together. It is ideally
    designed for local testing with your data-driven websites right
    there on your local machine... once it is achieved, then, of course
    you could upload the finished data-driven website over to your web
    server for general public use or specific audience.
    TO make this work, I suggest that you want to consider this
    book called, "PHP for Dreamweaver 8," who authored by David Powers.
    It is an excellent, excellent book. It covers many topics ranging
    from setting up PHP, MySQL and Apache web servers and few other
    important issues associated with installation of these apps on your
    local machine (whether it is Windows XP-based or Macs), other
    topics included how to build, develop and work with data-driven
    websites and realize important issues that arise under those topics
    discussed by the author.
    As for installation of opensource applications (PHP, MySQL,
    and Apache), it is a bit complicated, heavy-hand in order to make
    it work. That is why I am recommending you to get this book.
    I am curious, what Dreamweaver version you are working with?
    And what system architecture?

  • PHP form to output in PDF

    I was wondering if there is a php function or some type of
    code where you can make a php form and when the user clicks on a
    button it transfers their information to another page which opens
    up and displays it in PDF in the web browser. I remember seeing
    this done under Coldfusion MX, is there something similar for it in
    PHP?

    AdonaiEchad wrote:
    > I was wondering if there is a php function or some type
    of code where you can
    > make a php form and when the user clicks on a button it
    transfers their
    > information to another page which opens up in PDF.
    Look for example at fpdf (
    http://www.fpdf.org/) or ezpdf
    http://www.ros.co.nz/pdf/).
    Leolux

  • Php form data script

    Hi all
    would someone beable to help?
    I have been using a free php form data script on my website but I am finding that when people fill in the form that not all the form submissions are getting through and I am not sure if it is the php form script
    Would any one be to direct me to a good free php data script that is simple to use
    many thanks for your help!

    hi there
    many thanks for your help!
    ok, am  little new to this, so do you mean in my contact.php script I have?
    not sure what I would be looking for?
    I tried to attach to this post but copuld so zipped it for download here; http://www.thevineproject.org.uk/contact.zip
    thanks for your help

  • PHP Form Emailing Fields But No Data

    Hello,
    I am running into a little problem with my PHP form script.  I am able to email my form and receive a message, however the message has no data, except for where I have check boxes.  Can anyone help me solve this dilemma?  Some of the code has been remove intentionally.
    I will post my code:
    <?php
    /* Email Variables */
    $emailSubject = ' Registration Form';
    $webMaster = 'de';
    /* Data Variables */
    $registrationname = $_POST['registrationname'];
    $registrationphone = $_POST['registrationphone'];
    $registrationemail = $_POST['registrationemail'];
    $registrationdistrict = $_POST['registrationdistrict'];
    $registrationposition = $_POST['registrationposition'];
    $onecredit = $_POST['onecredit'];
    $twocredit = $_POST['twocredit'];
    $threecredit = $_POST['threecredit'];
    $body = <<<EOD
    <br><hr><br>
    Name of Register: $registrationname <br>
    Day Time Phone Number: $registrationphone <br>
    Email Address of Register: $registrationemail <br>
    Name of School District: $registrationdistrict <br>
    Position/Job Title: $registrationposition <br>
    Register for 1 Credit: Learning to Use the easyCBM Assessment System: $onecredit <br>
    Register for 2 Credits: In-Depth Knowledge of the easyCBM Assessment System: $twocredit <br>
    Register for 3 Credits: Enroll in Both of the Above Options: $threecredit <br>
    EOD;
    $headers = "From: $email\r\n";
    $headers .= "Content-type: text/html\r\n";
    $success = mail($webMaster, $emailSubject, $body,
    $headers);
    /* Results rendered as HTML */
    $theResults = <<<EOD
    <html>
    <head>
    <title>sent message</title>
    <meta http-equiv="refresh" content="6;URL=http://.html">
    <style type="text/css">
    <!--
    body {
    background-color: #D9D3A9;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 20px;
    font-style: normal;
    line-height: normal;
    font-weight: normal;
    color: #000000;
    text-decoration: none;
    padding-top: 200px;
    margin-left: 200px;
    width: 800px;
    -->
    </style>
    </head>
    <div align="center">Thank you! Your request has been sent.
    You will return to the page in a few moments.</div>
    </div>
    </body>
    </html>
    EOD;
    echo "$theResults";
    ?>

    1) I would bring the line <cfoutput query="CheckUser"> lower down in the code, for example, just before the first table tag.
    2)These are probably mistakes
    <<table border="0" align="center" cellpadding="0" cellspacing="0">
    <input type="hidden" name="LogDate" value="Now()">
    I think they should be
    <table border="0" align="center" cellpadding="0" cellspacing="0">
    <input type="hidden" name="LogDate" value="#Now()#">
    3) You could revise the action page to:
    <cfif isDefined("form.logDate")>
    <cfinsert datasource="manna_premier" formfields="LogDate,TerritoryManager,Status,DSRName,ServiceName" tablename="TMStatusLog">
    <cflocation url="mp_order_form.cfm">
    </cfif>
    The table TMStatusLog must of course have columns LogDate, TerritoryManager, Status, DSRName and ServiceName.

  • PHP Form mail

    I used this script
    http://www.visibilityinherit.com/code/php-form-validation.php
    to produce a form and everything worked fine on my site, which I
    was using for testing. When I transferred over to the client's site
    it doesn't send the email. The error and thank you messages work,
    but no email. As I have heard that some hosts block some php files
    with the name 'formmail' I called it something else.
    I have checked and rechecked all the data and only my email
    address and the URLs for the error and thank you pages had to be
    changed, my email is correct, but still not email.
    Any ideas as to what is happening and how I can get around it
    please?
    Rosalind

    I have been sent the following information and code, but have
    not succeeded in working out where to add it. The code I am using
    is underneath. Many thanks
    - to send emails through our servers you must comply with one
    of the following rules
    a. The sending email must be from your domain
    b. The receiving email must be from your domain
    This account could/should be [email protected]
    - To avoid a wrong use of our scripts by spammers you must
    had a line before you call the “mail” functionality
    ini_set("sendmail_from", " [email protected] ");
    - Please add to the email send code a functionality
    “-f” in the fifth parameter of the function send mail
    - This is the simple configuration of sending emails in php
    <?php
    ini_set("sendmail_from", [email protected]);
    mail($email_to, $email_subject, $email_message, $headers,
    '-f'[email protected]);
    ?>
    my php code is
    <?php
    // Input Your Personal Information Here
    $mailto = '[email protected]' ;
    $from = "FormosaParadise.com" ;
    $formurl = "
    http://formosaparadise.com/correios.php"
    $errorurl = "
    http://formosaparadise.com/formmailerror.php"
    $thankyouurl = "
    http://formosaparadise.com/thankyou.php"
    // End Edit
    // prevent browser cache
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "
    GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
    function remove_headers($string) {
    $headers = array(
    "/to\:/i",
    "/from\:/i",
    "/bcc\:/i",
    "/cc\:/i",
    "/Content\-Transfer\-Encoding\:/i",
    "/Content\-Type\:/i",
    "/Mime\-Version\:/i"
    if (preg_replace($headers, '', $string) == $string) {
    return $string;
    } else {
    die('You think Im spammy? Spammy how? Spammy like a clown,
    spammy?');
    $uself = 0;
    $headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" :
    "\n" ;
    if (!isset($_POST['email'])) {
    header( "Location: $errorurl" );
    exit ;
    // Input Your Personal Information Here
    $name = remove_headers($_POST['name']);
    $email = remove_headers($_POST['email']);
    $phone = remove_headers($_POST['phone']);
    $comments = remove_headers($_POST['comments']);
    $http_referrer = getenv( "HTTP_REFERER" );
    // End Edit
    if
    (!preg_match("/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i",$email))
    header( "Location: $errorurl" );
    exit ;
    // Input Your Personal Information Here
    if (empty($name) || empty($email) || empty($phone)
    ||empty($comments)) {
    header( "Location: $errorurl" );
    exit ;
    // End Edit
    if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) {
    header( "Location: $errorurl" );
    exit ;
    if (get_magic_quotes_gpc()) {
    $comments = stripslashes( $comments );
    // sets max amount of characters in comments area (edit as
    nesesary)
    if (strlen($comments) > 1250) {
    $comments=substr($comments, 0, 1250).'...';
    // End Edit
    $message =
    "This message was sent from:\n" .
    "$http_referrer\n\n" .
    // Input Your Personal Information Here
    "Name: $name\n\n" .
    "Email: $email\n\n" .
    "Phone No: $phone\n\n" .
    "Comments: $comments\n\n" .
    "\n\n------------------------------------------------------------\n"
    // End Edit
    mail($mailto, $from, $message,
    "From: \"$name\" <$email>" . $headersep . "Reply-To:
    \"$name\" <$email>" . $headersep );
    header( "Location: $thankyouurl" );
    exit ;
    ?>

  • Php form processing script

    Hi. I got a program to write a php form processing script. My submit form is for photo submission to my domain email. I published to site and did a test to see if it works i got this error:
    Warning: require_once(F:\Domains\mydomain\mydomain.com\wwwroot/includes/Upload_Photos-lib.php): failed to open stream: No such file or directory in F:\Domains\mydomain\mydomain.com\wwwroot\Upload_Photos.php on line 24 Fatal error: require_once(): Failed opening required 'F:\Domains\mydomain\mydomain.com\wwwroot/includes/Upload_Photos-lib.php' (include_path='.;C:\php\pear') in F:\Domains\mydomain\mydomain.com\wwwroot\Upload_Photos.php on line 24
    What does this mean? How can i solve this so that i can process my form?

    See if the below form helps: You need to create a folder on your server named - upload - this is where any files uploaded will be stored (make sure the folder is writable. Also change the email address where the information that someone who has uploaded a file will go to. Look for the following in the code: $to ="XXXXXXXXXXXX.com";
    <!DOCTYPE html>
    <head>
    <meta charset="UTF-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    #wrapper {
    width: 400px;
    margin: 0 auto;
    </style>
    </head>
    <body>
    <div id="wrapper">
    <?php if(isset($_POST['submit'])) {
    $name = trim($_POST['name']);
    if(empty($name)) {
    $error['name'] = "Please provide your name";
    $location = trim($_POST['location']);
    if(empty($location)) {
    $error['location'] = "Please provide your location";
    $email = trim($_POST['email']);
    if(empty($email)) {
    $error['email'] = "Please provide your email";
    $category_description = trim($_POST['category_description']);
    if(empty($category_description)) {
    $error['category_description'] = "Please provide the category or description";
    $terms_conditions = trim($_POST['terms_conditions']);
    if(empty($terms_conditions)) {
    $error['terms_conditions'] = "Please accept the terms & conditions";
    $allowedExts = array(
       "doc",
      "docx",
            "rtf",
            "txt",
            "pdf",
            "jpeg",
            "jpg",
    $allowedMimeTypes = array(
      'application/msword',
            'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
            'application/rtf',
            'application/x-rtf',
            'text/richtext',
            'text/rtf',
            'application/plain',
      'application/pdf',
      'image/gif',
      'image/jpeg',
    $extension = end(explode(".", $_FILES["file"]["name"]));
    if (empty($_FILES["file"]["name"])) {
        $selectFile = 'Please select a file to upload';
    elseif ( ! ( in_array($extension, $allowedExts ) ) ) {
      $fileTypeNotAllowed = 'File type not allowed';
    elseif ($_FILES["file"]["size"] > 2097152) {
      $fileTooLarge = 'Please provide a smaller file';
    elseif (file_exists("upload/" . $_FILES["file"]["name"])) {
    $fileExists = $_FILES["file"]["name"] . " already exists, Please change the file name ";
    elseif (in_array( $_FILES["file"]["type"], $allowedMimeTypes ) )
        if(!empty($_POST['terms_conditions'])) {
    move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]);
        $fileName = $_FILES["file"]["name"];
        $fileUploadSuccessful = 'File uploaded successfully';
    $to = "XXXXXXXXXXXXX.com";
    $subject   = "Upload to website";
    $headers  = "From: $email\r\n";
    $headers .= "Reply-To: $email\r\n";
    $message = "Name: $name\n\n";
    $message .= "Location: $location\n\n";
    $message .= "Email Address: $email\n\n";
    $message .= "Category/Description: $category_description\n\n";
    $message .= "File: $fileName\n\n";
    mail($to, $subject, $message, $headers);
    $sent = "Mail was sent successfully";
    ?>
    <h1>Form</h1>
    <?php
    foreach ($error as $value) {
        echo "<p>".$value."</p>";
    if(isset($formFieldError)) {
    echo "<p>".$formFieldError."</p>";
    if(isset($selectFile)) {
    echo "<p>".$selectFile."</p>";
    if(isset($fileTypeNotAllowed)) {
    echo "<p>".$fileTypeNotAllowed."</p>";
    if(isset($fileTooLarge)) {
    echo "<p>".$fileTooLarge."</p>";
    if(isset($fileExists)) {
    echo "<p>".$fileExists."</p>";
    if(isset($fileUploadSuccessful)) {
    echo "<p>".$fileUploadSuccessful."</p>";
    ?>
    <form action="upload_file.php" method="post"
    enctype="multipart/form-data">
    <p>
    <label for="name">Name<br>
    <input type="text" name="name" id="name" value="<?php if(isset($name)) {echo $name; }  ?>"/>
    </label>
    </p>
    <p>
    <label for="location">Location<br>
    <input type="text" name="location" id="location" value="<?php if(isset($location)) {echo $location; }  ?>"/>
    </label>
    </p>
    <p>
    <label for="email">Email<br>
    <input type="text" name="email" id="email" value="<?php if(isset($email)) {echo $email; }  ?>" />
    </label>
    </p>
    <p>
    <label for="category_description">Category and Description<br>
    <input type="text" name="category_description" id="category_description" value="<?php if(isset($category_description)) {echo $category_description; }  ?>" />
    </label>
    </p>
    <p>
    <label for="file">File Attachment:<br>
    <input type="file" name="file" id="file" />
    </label>
    </p>
    <p>
    <label for="terms_conditions">Terms & Conditions:
    <input name="terms_conditions" type="checkbox" value="accept" <?php if(isset($_POST['terms_conditions'])) {echo "checked"; }  ?>> (Please check)
    </label>
    </p>
    <input type="submit" name="submit" value="Submit" />
    </form>
    </div>
    </body>
    </html>

  • Php form not sending

    i have been lately having trouble with a php form. it will not send the form out to me when they submit it. is there something wrong with the coding? it works for me.

    future-architect wrote:
    Is there anybody here that knows how to do php coding?
    Yes, but you should post questions about PHP in the right forum: Dreamweaver Application Development. Also, don't just keep adding new questions to an old thread. Everything might seem related to you, but other people see a thread that has already received a lot of replies, and are likely to skip it unless they have already been involved. Take a look at this post about how to get help quickly.

Maybe you are looking for

  • Authorization control for document status

    Dear All, I want to control the status change of Documets created, How can i achieve this, so that a perticular user /ID can change the perticular status, I have , 01 02, 03, 04, Rel. 05, Do i need to put some trace anf find Objects to control... or

  • Filter members having transaction data in Script logic

    Does anyone know a way to limit the scope of script/runallocation on only those members that have data? I'm trying to run an allocation on all the products which and i cannot run it for more than 500 at a time. The script always gets canceled. Thanks

  • ME55 - Release Purchase Request

    Hi Gurus, I am facing problem in T-Code ME55 throwing message by SU53 that authorization obj : M_BANF_FRG and Pur. Req. Release code x9. I have changed Role and assign the said obj. but when i exec. the t-code me55 this execute sucessfully. But there

  • Informatica 9.0.1 installation on windows

    Hi All, I want to install informatica 9.0.1 on windows 32 bit or 64 bit Can u please suggest me which one i have to download, in oracleedelivery link iam finding 3 files to download, Can i have to download 3rd one or first two or both?? and how to in

  • How to transfer and use the project files from Premiere Pro cs6 MAC OS to Premiere Pro CS6 Windows

    Is there any plugin or tool that can help me to transfer my project files along data edited on adobe premiere cs6 MAC OS to the adobe premiere pro cs 6 on windows PC