+ Reply to Thread
Results 1 to 6 of 6

Thread: Simple PHP Help Pleeeeease!

  1. #1
    ny-1373 is offline x10Hosting Member ny-1373 is an unknown quantity at this point
    Join Date
    Jul 2011
    Posts
    2

    Simple PHP Help Pleeeeease!

    Hey there,

    Just wondering if anyone can help me with my email form, It doesn't seem to send the actual mail.

    Heres the code for the form

    PHP Code:
     <form method="post" action="sendeail.php">          <!-- DO NOT change ANY of the php sections -->          <?php$ipi getenv("REMOTE_ADDR");$httprefi getenv ("HTTP_REFERER");$httpagenti getenv ("HTTP_USER_AGENT");?>          <input type="hidden" name="ip" value="<?php echo $ipi ?>" />          <input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />          <input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />          <br />  <input name="visitor" type="text" value="Name" size="35" />  <br />          <br />  <input name="visitormail" type="text" value="Email" size="35" />  <br />  <br />  <select name="attn" size="1">    <option value="Insulation" selected="selected">Insulation</option>    <option value="Solar">Solar</option>    <option value="General Contact">General Contact</option>    <option value=" Webmaster ">Webmaster </option>  </select>  <br />          <br />  <textarea name="notes" rows="4" cols="40">Address</textarea>  <br />  <br />  <input type="submit" value="Send Mail" />          Mail Message: <br />  <br />  <br />        </form>
    and heres the send script:

    PHP Code:
    <?php
    $ip 
    $_POST['ip']; $httpref $_POST['httpref']; $httpagent $_POST['httpagent']; $visitor $_POST['visitor']; $visitormail $_POST['visitormail']; $notes $_POST['notes'];$attn $_POST['attn'];
    if(!
    $visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,"."))) {echo "<h2>Use Back - Enter valid e-mail</h2>\n"$badinput "<h2>Feedback was NOT submitted</h2>\n";echo $badinput;die ("Go back! ! ");}
    if(empty(
    $visitor) || empty($visitormail) || empty($notes )) {echo "<h2>Use Back - fill in all fields</h2>\n";die ("Use back! ! "); }
    $todayis date("l, F j, Y, g:i a") ;
    $attn $attn $subject $attn
    $notes stripcslashes($notes); 
    $message $todayis [EST] \nAttention: $attn \nMessage: $notes \n From: $visitor ($visitormail)\nAdditional Info : IP = $ip \nBrowser Info: $httpagent \nReferral : $httpref \n";
    $from "From: $visitormail\r\n";

    mail("ny-13@hotmail.com"$subject$message$from);
    ?>
    <p align="center">Date: <?php echo $todayis ?> <br />Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> ) <br />
    Attention: <?php echo $attn ?><br /> Message:<br /> <?php $notesout str_replace("\r""<br/>"$notes); echo $notesout?> <br /><?php echo $ip ?> 
    <br /><br /><a href="contact.php"> Next Page </a> </p>

  2. #2
    mobstermind61's Avatar
    mobstermind61 is offline x10Hosting Member mobstermind61 is an unknown quantity at this point
    Join Date
    Jul 2011
    Location
    Pennsylvania
    Posts
    47

    Re: Simple PHP Help Pleeeeease!

    did you create the right file for the send email script, because if you created the file call sendemail.php then the action at the top is wrong because the sendeail.php is spelled differently, i had that issue before. Make sure you rename the file to sendeail.php or rename the code in the form to sendemail.php.

    Links| www.pawebdesigner.com | Join My Group | Visit My Profile | My Activity |Links
    If I helped you please give me Reputation by clicking star Icon at the bottom left hand corner of my posts.


  3. #3
    ny-1373 is offline x10Hosting Member ny-1373 is an unknown quantity at this point
    Join Date
    Jul 2011
    Posts
    2

    Re: Simple PHP Help Pleeeeease!

    Quote Originally Posted by mobstermind61 View Post
    did you create the right file for the send email script, because if you created the file call sendemail.php then the action at the top is wrong because the sendeail.php is spelled differently, i had that issue before. Make sure you rename the file to sendeail.php or rename the code in the form to sendemail.php.
    Yeah, I noticed that typo and I changed the file name. Still doesnt work, Is there a working script online anywhere that I can just copy and paste in?...

  4. #4
    essellar's Avatar
    essellar is offline Community Advocate essellar has a spectacular aura about
    Join Date
    Feb 2010
    Location
    Toronto, Ontario, CA
    Posts
    1,153

    Re: Simple PHP Help Pleeeeease!

    If you're running the script here on a Free Hosting plan, you'll find that it's the $from variable that's preventing the mailsend. You can only send mail from a mail account that actually exists in your Free Hosting account -- spoofing the sender (or any other part of the email header) is not allowed.
    “Beware of bugs in the above code; I have only proved it correct, not tried it.” --Donald Knuth
    "It was as if its architects were given a perfectly good hammer and gleefully replied, 'neat! With this hammer, we can build a tool that can pound in nails.'" -- Alex Papadimoulis (on TheDailyWTF.com)

  5. #5
    mobstermind61's Avatar
    mobstermind61 is offline x10Hosting Member mobstermind61 is an unknown quantity at this point
    Join Date
    Jul 2011
    Location
    Pennsylvania
    Posts
    47

    Re: Simple PHP Help Pleeeeease!

    I would use this contact form http://www.freecontactform.com/email_form.php It seems to be structured a little better. I know the contact form your using and its not exactly the best one to use that is free, the one on the other side of the link i provided for you is a much better one, let me know if you need help. Ill be glad to walk you through the steps if need be.

    ---------- Post added at 11:07 AM ---------- Previous post was at 10:57 AM ----------

    I just noticed something, also a lot of the times a php form will not allow you to receive an email to a aol, live or sub email account, for some reason they don't allow it so you would need to create an email account in your cpanel like admin@yourwebsite.com to actually receive an email from a client.

    mail("ny-13@hotmail.com <----that will not work ", $subject, $message, $from);

    Links| www.pawebdesigner.com | Join My Group | Visit My Profile | My Activity |Links
    If I helped you please give me Reputation by clicking star Icon at the bottom left hand corner of my posts.


  6. #6
    fretwizz is offline x10Hosting Member fretwizz is an unknown quantity at this point
    Join Date
    Jun 2008
    Posts
    57

    Re: Simple PHP Help Pleeeeease!

    FYI there can be issues with copying and pasting php scripts. That aside... I see the need for a space in your form tag after the php tag.

+ Reply to Thread

Similar Threads

  1. Get Simple cms
    By zetsab11 in forum Scripts & 3rd Party Apps
    Replies: 0
    Last Post: 10-27-2010, 05:43 AM
  2. Simple CSS Help please
    By WarriorH in forum Programming Help
    Replies: 1
    Last Post: 07-17-2008, 09:16 AM
  3. a simple ?
    By swirly in forum Free Hosting
    Replies: 5
    Last Post: 11-06-2006, 06:55 PM
  4. New Simple Sig
    By phenetic in forum Graphics & Webdesign
    Replies: 2
    Last Post: 02-23-2005, 08:29 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