The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 3 of 3

Thread: PHP Contact Form

  1. #1

    PHP Contact Form


    I am new to PHP, I am trying to create a contact form using html and php. I found the tutorial on this website to create one. Problem is, whenever I submit the form it displays the php code in the browser. Any help on how to resolve this would be greatly appreciated.

    The code I have is,

    HTML Code:
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>New Page 1</title>
    <form method="POST" action="mailer.php">
     <input type="text" name="name" size="19"><br>
     <input type="text" name="email" size="19"><br>
     <input type="checkbox" name="check[]" value="blue_color"> Blue<br>
     <input type="checkbox" name="check[]" value="green_color"> Green<br>
     <input type="checkbox" name="check[]" value="orange_color"> Orange<br>
     <input type="radio" value="yes" name="radio"> YES<br>
     <input type="radio" value="no" name="radio"> NO
     <select size="1" name="drop_down">
     <textarea rows="9" name="message" cols="30"></textarea><br>
     <input type="submit" value="Submit" name="submit">
    PHP Code:
    if(isset($_POST['submit'])) {
    $to ""
    $subject "Form Tutorial";
    $name_field $_POST['name'];
    $email_field $_POST['email'];
    $message $_POST['message'];
    $option $_POST['radio'];
    $dropdown $_POST['drop_down'];
    $_POST['check'] as $value) {
    $check_msg .= "Checked: $value\n";
    $body "From: $name_field\n E-Mail: $email_field\n $check_msg Option: $option\n Drop-Down: $dropdown\n Message:\n $message\n";
    "Data has been submitted to $to!";
    } else {


  2. #2
    jwilliam's Avatar
    An intellectual carrot!
    If you're seeing the php code in your web browser then your web server is not setup to run php scripts correctly. If this is shared hosting, then check out the company's website or contact their customer support to get it resolved. If you're setting it up yourself there are plenty of tutorials online for configuring php with Apache... and I'm sure for IIS (or whatever you're using) as well...

  3. #3

    It Works!!!!!!!!`

    Hello towise,

    its run @ my end so it it problem with php. Please check any php file is run or not or might be you are trying to run our of host(where we can run php/asp like scripting file)

    Get back to me if you have an issue


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012