few questions: mail() error and purpose of @

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
haosmark
Forum Newbie
Posts: 10
Joined: Wed Mar 19, 2008 12:10 pm

few questions: mail() error and purpose of @

Post by haosmark »

Good evening,
1) I have the following code:

Code: Select all

    function process_form($data) {
        $msg = "The form at {$_SERVER['PHP_SELF']} was submitted with these values:\r\n";
        foreach($data as $key => $val)
            $msg .= "$key => $val \r\n";
        mail('myemail@gmail.com', 'form submission test', $msg);
    }
For some reason php return an error:
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\wamp\www\practice\forms_basics\form_validation.php on line 77
I changed php.ini and still get this error message and php docs don't show a custom FROM parameter in mail function, how do i fix this?

2)

Code: Select all

<input type = "text" name = "first" value = "<?php echo @$method['first']; ?>" />
What is the purpose of '@' in

Code: Select all

@$method['first'];
?

Thanks.
Post Reply