Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi Over the last few days I have been attempting to create (and publish) a contact form following the instructions in your on-line manual. I created a simple site with 2 pages (the second page contains the form). Then loaded it to the web. When the browser attempted to open the page containing the form (called 'contact.php') it returned the message of "Parse error: syntax error, unexpected T_VARIABLE in /freeola/users/2/1/sr0876612/htdocs/contact.php on line 32". Since receiving this message I have:- 1 - Gone through the manual instructions again to make sure I had not left anything out / made an error input etc 2 - Checked with my web host company that they accept PHP coded sites - they do (see PS below) 3 - Reloaded the site to the web host servers 4 - Put the code created in contact.php through 2 code testing packages - no errors detected 5 - Read through this Forum (for similar issues) 5 - Run out of ideas.....!!! Do you have any idea what I have done wrong ? Can you give me the URL of a site that has successfully created a Contact Form using you instructions so I can go and have a look at the source code to see if I can sort this out? PS - My hosting company does make the following comments about sites with PHP code...... http://freeola.com/support/php-scripting-essentials.html ..... could the problem be because of PHP File & Folder Premissions. I use their 'standard hosting' and used CyberDuck as my FTP. I use WebSitePainter for a couple of site developments. Both developments have been very successful. But developing a contact form has beaten me - any help will be appreciated. Many thanks |
||||
|
Hi, the error you get means that the code you typed into the PHP element has some syntax error in it. Did you modify the code maybe? What does it look like exactly? Does it look like this? $text = ""; |
||||
|
Hi This is the code I have in the PHP Code box.... $text = ""; foreach($_POST as $name => $value) { $text .= "$name : $value\n"; } if ($text != "") { echo 'Thanks for contacting us.'; mail("andrew@andrewandcat.co.uk", "Contact form request", $text); } I placed the code in the box via cut & paste - I did not write the code in. The only typing I did was to replace the example email address with a real one. I am on WebsitePainter 2.0.1 Thanks |
||||
|
Strange, looks ok for me. Maybe you could send me your .wspd file and I'll have a closer look at it? Maybe mail adress written on the page under Support -> Contact. |
||||
|
Just sent the file to you via office@ambiera.com |
||||
|
To anyone with the same problem I had. This is the solution Niko emailed me with..... I took a look at it and was able to fix it. Simply remove the spaces at the beginning of each lines, somehow, those are evil for some reasons. The code should then look like this: $text = ""; foreach($_POST as $name => $value) { $text .= "$name : $value\n"; } if ($text != "") { echo 'Thanks for contacting us.'; mail("andrew@andrewandcat.co.uk", "Contact form request", $text); } I'm not entirely sure what happened there and why the spaces/tabs in your code are not liked, but removing them fixes it. Must have been some way they have been copied, maybe. I then tested Niko's solution and it worked. Perhaps the core of the problem was the way my computer copies and pastes - I used CMD + C to copy and CMD + V to paste, I work on an iMac. |
||||
|
I would recommend Code Shacks contact form, its really easy to implement and the code is easy to understand http://codetutorial.caroshaw.com/jquery_image_slider.php |
|