开发者

PHP write to email problem [closed]

Closed. This question needs debugging details. It is not currently accepting answers. 开发者_JAVA技巧

Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.

Closed 5 years ago.

Improve this question

I have the following script which creates an email from a contact form: http://codeviewer.org/view/code:1b54

I am having trouble getting the contents of the 'heard' drop down list (line 49) to output to the email.

I can successfully output the selected value on line 99 but when i try to add it to the email on line 131 nothing appears. I get the Heard: but not the actual value.

Any suggestions?

Thanks!


If I understood correctly - $heard is a global variable that is defined on line 88 so it is not avaliable inside a function. Change

global $to, $extra;

to

global $to, $extra, $heard;

this should help.

Upd: I think you should read about variable scopes in PHP: http://php.net/manual/en/language.variables.scope.php .

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜