Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why won't it run? (PHP)
#1
Well, I followed a tutorial on how to make a contact form with HTML/PHP (the one in the stickied list) and everytime I click on the "Submit" button, I get this:

[Image: captureyao.png]

Uploaded with ImageShack.us


In IE it "downloads" itself, in Chrome it just gets opened in the new tab like a text file. What's wrong?
Reply
#2
where is the source code ???????????????
Reply
#3
Sorry lol, I thought I posted it

HTML:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
    font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
    background: #42413C;
    margin: 0;
    padding: 0;
    color: #000;
}

/* ~~ Element/tag selectors ~~ */
ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */
    padding: 0;
    margin: 0;
}
h1, h2, h3, h4, h5, h6, p {
    margin-top: 0;     /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */
    padding-right: 15px;
    padding-left: 15px; /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */
}
a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */
    border: none;
}
/* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */
a:link {
    color: #42413C;
    text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */
}
a:visited {
    color: #6E6C64;
    text-decoration: underline;
}
a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */
    text-decoration: none;
}

/* ~~ this fixed width container surrounds all other elements ~~ */
.container {
    width: 960px;
    background: #FFF;
    margin: 0 auto; /* the auto value on the sides, coupled with the width, centers the layout */
}

/* ~~ This is the layout information. ~~

1) Padding is only placed on the top and/or bottom of the div. The elements within this div have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the div itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design.

*/
.content {
    padding: 10px 0;
    text-align: left;
}

/* ~~ miscellaneous float/clear classes ~~ */
.fltrt {  /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
    float: right;
    margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */
    float: left;
    margin-right: 8px;
}
.clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the overflow:hidden on the .container is removed */
    clear:both;
    height:0;
    font-size: 1px;
    line-height: 0px;
}
-->
</style></head>

<body>

<div class="container">
  <div class="content">
    <h1>CONTACT US!!</h1>
    

    <p>
      
      <!-- end .content --></p>
    <form id="form1" name="form1" method="post" action="send.php">
      <p>
        <label for="name">Name:</label>
        <input type="text" name="name" id="name" />
      </p>
      <p>
        <label for="email">E-Mail:</label>
        <input type="text" name="email" id="email" />
      </p>
      <p>
        <label for="comments">Comments</label>
        <textarea name="comments" id="comments" cols="45" rows="5"></textarea>
      </p>
      <p>
        <input type="submit" name="button" id="button" value="Submit" />
      </p>
    </form>
    <p>&nbsp;</p>
  </div>
  <!-- end .container --></div>
</body>
</html>

PHP
Code:
<?php
$name = $_POST['name']; //this is where the value of your inputs go
$email = $_POST['email']; //value of your email input goes here
$message = $_POST['comments']; //value of your textarea goes here
$type = $_POST['type'];
$to = "******@********.com"; //put your email here so it sends to your email :P

mail($to, "Feedback Results", $message, "From:$email"); // you can edit these, these are what your email message will tell you as the subject.

?>
Reply
#4
It might be a hosting issues?

Whats host your own?
Reply
#5
We have a own section for coding.;)
Reply
#6
I want to run it on my local computer. I downloaded and installed XAMMP but it won't run anyways.
Reply
#7
Download Wampserver. Use this video for guidance.
[Image: cooldude.png]

(09-05-2011, 08:36 AM)Orgy Wrote: If you understand what you're doing, you aren't learning anything. ;)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to run a forum [Personal Experience] Laughynose 16 3,215 06-19-2011, 04:28 AM
Last Post: notLuke
  [PHP] - PHP White Paper --([-S7N-])-- 1 1,069 04-13-2010, 09:42 PM
Last Post: SLiM

Forum Jump:


Users browsing this thread: 1 Guest(s)