new in php please help

Discussion in 'PHP' started by Hunter47, Dec 12, 2008.

  1. #1
    hi im new in php and i do form in flash when i hit "send" it will load php file with details: where to send (email)..(i upload it to the my site but i diden't see no mail when i hit "send") i don't know if the script is right can someone look at the script and tell me if it right?
    and if there is a another way to do it (flash with php)
    if someone can help it will be great .

    <?php 
    $sendTo = "cosher1@gmail.com"; 
    $subject = "contact form";
    $headers = "From: " . $_POST["name"]; 
    $headers .= "<" . $_POST["email"] . ">\r\n"; 
    $headers .= "Reply-To: " . $_POST["email"] . "\r\n"; 
    $headers .= "Return-Path: " . $_POST["email"]; 
    $message = $_POST["message"];
    mail($sendTo, $subject, $message, $headers); 
    ?>  
    PHP:
     
    Hunter47, Dec 12, 2008 IP
  2. allisonkrauss

    allisonkrauss Banned

    Messages:
    90
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    allisonkrauss, Dec 12, 2008 IP
  3. crivion

    crivion Notable Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    210
    Digital Goods:
    3
    #3
    check if your mail function is active on the hosting side
    also
    put this on the begining of the file and see if somethings wrong
    <?php
    error_reporting(E_ALL);
    ?>
    anyway, in the most cases its hosting issue which disabled mail function
     
    crivion, Dec 12, 2008 IP
  4. Hunter47

    Hunter47 Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    hi im new in all this php stuff,what i need to see if it active or how actived it?
     
    Hunter47, Dec 14, 2008 IP
  5. crivion

    crivion Notable Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    210
    Digital Goods:
    3
    #5
    what to see if active or not?
     
    crivion, Dec 14, 2008 IP
  6. Hunter47

    Hunter47 Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    how do i know that..what i need to see that cofirm it disabled and how i active it?
     
    Hunter47, Dec 14, 2008 IP
  7. crivion

    crivion Notable Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    210
    Digital Goods:
    3
    #7
    create a php file where you just type
    <?php
    phpinfo();
    ?>
    or just do it in this way
    <?php
    if(mail($to, et. etc.)) {
    print "sent";
    }else{
    print "not";
    }
    ?>
     
    crivion, Dec 14, 2008 IP
  8. geekranger

    geekranger Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    maybe you can check your SMTP setting.
     
    geekranger, Dec 16, 2008 IP