Results 1 to 6 of 6

Thread: PHP Form on .html site

  1. #1
    Join Date
    Jan 2008
    Location
    Colorado
    Posts
    38
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Unhappy PHP Form on .html site

    So I'm having an issue and was curious if I need to rewrite the rest of my site in php, get a different host, or change my coding. My site is written in HTML as is the form, but the way the form is processed is through a PHP page. Any ideas as to why the code will not send the form to my email?

    I use freehostia.com currently so I'm not sure if that may be the problem.
    This is the link to my site if it will help http://euphoriastudio.freehostia.com

    html page the form appears on:
    HTML Code:
    <html>
    <head>
    <title>Quote</title>
    </head>
    <body>
    <form method="post" action="sendmail.php">
    Name:<br><input type="text" size="50" maxlength="120" name="name"><p>
    Phone:<br><input type="text" size="50" maxlength="120" name="phone"><p>
    Email:<br><input type="text" size="50" maxlength="120" name="email"><p>
    
    What you need:<br>
    <input type="checkbox" name="need" value="Website">Website
    <br> 
    <input type="checkbox" name="need" value="Redesign">Re-Design
    <br>
    <input type="checkbox" name="need" value="Template">Template Modification
    <br>
    <input type="checkbox" name="need" value="Graphics">Graphic Design
    <br> 
    <input type="checkbox" name="need" value="LogoBrand">Logo/Brand Creation
    <br>
    <input type="checkbox" name="need" value="Ad">Advertising Ad
    <br>
    <input type="checkbox" name="need" value="Banner">Banner Ad<p>
    
    Project Description:<br><textarea rows="5" cols="40" name="descrip">
    Try to be as descriptive as possible. Include deadlines, features, and a budget range. Also include times you are available to receive calls.
    </textarea><p>
    
    <input type="submit" value="submit" name="submit"><br />
    </form><br />
    </body>
    </html>

    this is the page the form is processed through:
    PHP Code:
    <?php
    $required 
    = array('phone''email''name');
    foreach(
    $required as $v){
    if(empty(
    $_POST[$v])){
    echo 
    'sorry, '.htmlspecialchars($v).' needs to be filled in';
    die();
    }

    $name $_REQUEST["name"];
    $phone $_REQUEST["phone"];
    $email $_REQUEST["email"];
    $need $_REQUEST["need"];
    $descrip $_REQUEST["descrip"];
    $embody "Name: $name\n Phone: $phone\n Email: $email\n Project: $need\n Description: $descrip\n";

    mail("euphoria.studio@gmail.com""New Client Request"$embody"From: $name <$email>" )
      or die(
    "Can't send email");
      
    header"Location: http://euphoriastudio.freehostia.com/index.html" );
    ?>
    Any help is greatly appreciated. I'm a total novice when it comes to PHP so bear with me if I'm having trouble.
    Last edited by euphoriastudio; 10-10-2008 at 05:10 PM. Reason: clarification

  2. #2
    Join Date
    Oct 2006
    Posts
    183
    Thanks
    0
    Thanked 11 Times in 11 Posts

    Default

    Does it give the "Can't send email" error that you ahve in the sendmail.php code, or does it act as if it sent but then doesn't ever get to the inbox?

  3. #3
    Join Date
    Jan 2008
    Location
    Colorado
    Posts
    38
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    It acts as if it sent it. It returns me to the /main.html page like I set it to. But nothing shows up in my email.

  4. #4
    Join Date
    Jan 2008
    Location
    Colorado
    Posts
    38
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Any ideas at all?

  5. #5
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    If it acts like it is sending, first try to see if its related to the variables. So 'create' a default body, meaning don't use the values the user selects, but rather use your own values explicitly.

    Code:
    mail("euphoria.studio@gmail.com", "New Client Request", "Testing Email", "From: someone <someoneelse@gmail.com>" )
      or die("Can't send email");

  6. #6
    Join Date
    Jan 2008
    Location
    Colorado
    Posts
    38
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Talking

    Thanks so much everyone for your greats suggestions, I did some digging and after many requests for help from my host found out its their fault. Script must be fine but the host doesnt allow the mail() tag in php. Again I'm very grateful for all the help here!

Bookmarks

Posting Permissions

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