![]() |
| ||
| please help I keep getting this message what is wrong with my sacript??? Parse error: syntax error, unexpected $end in /home/sites/thefieldinggallery.co.uk/web/contact_form.php on line 65 here is the php script: <?php |
| ||
| Re: please help When using heredoc, you must open and close the variable with the same identifier. $body = <<<emshould be: $body = <<<EOD Also, variables in php are case sensitive, so you'll have a blank page unless you change echo "$theresults";to echo "$theResults"; |
| ||
| Re: please help Thank you you are a life saver Cheers bro |
| ||
| Re: please help Glad to help. |
| ||
| Re: please help Next time, wrap your code in code tags when posting to keep things neat. There are plenty of people here to help out. Keeping things neat will improve your chances of getting help. |
| ||
| Re: please help Im new at this and got it from a tutorial. i don't know how to wrap in a tag sorry its messy! I do have another question though as it has worked and the mail is coming through but the content of the form isn't attached just the headers. can you see what is wrong there???? i would be most grateful |
| ||
| Re: please help Wrap the code like so: [code=php]Code goes here[/code] As to your problem, your email contains undefined variables. For instance you define namefield as $nameField = $_POST['name'];but in the email you send, you have the undefined variable $name instead of the defined $nameField. |
| ||
| Re: please help OK so do i take that as it should look like this? $nameField = $_POST['nameField']; I hope im not doing your head in with the questions but as i said i am a total newby at this |
| ||
| Re: please help The name the element has in the form goes inside the brackets. So if your form has <input name="name" type="text" id="name" tabindex="16" />After the form is submitted, PHP can assign the value posted to the variable. Here we assign the value of the textbox above to the variable $nameField: $nameField=$_POST['name'];Now if you want to use that variable in your email, you'll need to use the variable just defined. $body = <<<EOD Get it?? |
| ||
| Re: please help My Friend as far as i am concerned you are a god in the PHP world i can not say thank you enough Cheers Adam |
| All times are GMT -4. The time now is 2:08 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC