Page 1 of 1

few questions: mail() error and purpose of @

Posted: Sat Apr 12, 2008 2:18 pm
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.