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
to
this should help.
Upd: I think you should read about variable scopes in PHP: http://php.net/manual/en/language.variables.scope.php .