Jump to content


[Snippet] InquiryForm


  • You cannot reply to this topic
35 replies to this topic

#1 lloyd_borrett

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 605 posts
  • Gender:Male

Posted 24 March 2007 - 03:39 AM

File Name: InquiryForm
File Submitter: lloyd_borrett
File Submitted: 24 Mar 2007
File Category: Feedback / E-Mail Forms

/**
* ---------------------------
* Snippet: InquiryForm
* ---------------------------
* Version: 1.3 - 2007-03-24
*
* Description:
* This snippet generates a form, for an Inquiry Form.
* It first outputs the form, then it checks the responses
* that the sender has given, plus any other required fields.
* Finally it produces a "message-has-been-sent" page if
* everything is okay, sends an email containing the
* form details to the email address specified plus
* a copy to the user.
*
* This snippet can check for valid Australian Postcodes,
* phone numbers, and mobile phone numbers.
* You'll need to turn this checking off in the configuration
* section if you want to accept those values for other countries.
*
* NOTE: Make sure the Etomite document the snippet is called
* from is non-Cacheable!
*
* See it online at http://www.chapman-hill.com/request-info.htm
*
* Usage: [!InquiryForm
*
* ?div=[false|0] | someclass
* if not specified then div isn't output
* if false|0 then the div isn't output
*
* !]
*
* History:
* 2007-03-24 1.3 Lloyd Borrett
* Made BCC email address easily configurable.
* Turn on or off Australian phone, mobile and postcode checking.
* URL of privacy policy made a configuration option.
* Added ability to pass a div class wrapper, if div required.
* Updated Postcode checking to handle 3 digit postcodes.
*
* 2006-11-14 1.2 Lloyd Borrett
* Used fieldset to better group label and input.
*
* 2006-11-09 1.1 Lloyd Borrett
* Added City and Postcode fields.
*
* 2006-09-21 1.0 Lloyd Borrett, www.borrett.id.au, lloyd@borrett.id.au
* Adapted from EnergyAgreement snippet by Lloyd Borrett which was
* in turn adapted from the ContactMe 0.1 snippet by Vassili Slessarenko
*/


Click here to download this file

#2 gbryanmiller

    Etomite Forum Fan

  • Member
  • Pip
  • 65 posts

Posted 08 May 2007 - 06:59 PM

Hi Lloyd,

I'm having a little trouble getting this snippet to work. I have copied the snippet as-is and only changed the email address to test it out. No matter what I do, I cannot get it to send the email. I always get the "Problem - The email couldn't be sent" message.

Originally, I was getting the SAFE_MODE error and had my hosting company turn off SAFE_MODE. Now I just cannot get it to successfully send.

I have narrowed it down to being a hosting specific issue. I tested the script on another hosting company that I use and the script works fine.

Specs for the hosting company that does not work on:

Linux/Apache 2.0.5.4 /MySQL/PHP Version 5.0.4-0.9sarge1 (Debian GNU/Linux)

Also, I am not sure if this has anything to do with it, but I have attached a screencap of the php configuration screen in my hosting admin that shows the php modules that are currently installed or not installed.

Any ideas on what might be the issue? Could it be a PHP 5 issue? Or maybe a php module that needs to be activated?

Thanks,

Bryan

Attached Files


Edited by gbryanmiller, 08 May 2007 - 06:59 PM.


#3 gbryanmiller

    Etomite Forum Fan

  • Member
  • Pip
  • 65 posts

Posted 08 May 2007 - 07:36 PM

Ok, so it turns out that this host does not support the php sendmail function.

From the hosts knowledgebase:

Quote

For security reasons, we do not support SendMail on our Linux/Apache web servers. We support Mail::Sendmail (Perl) and PEAR Mail::Factory (PHP) instead. To send mail from Linux/Apache web server you need to use the appropriate method, and specify "scriptmail.intermedia.net" as the SMTP server.

Any idea how I can convert this to using SMTP based on the info provided by the host?

Thanks,

Bryan

#4 espersen

    Etomite Forum Fan

  • Member
  • Pip
  • 144 posts

Posted 15 May 2007 - 08:13 AM

Hi - Is there any work around to make this snippet work on a webserver that has SAFE_MODE on ?

If not: Other solutions for at contactform ?

Other snippets I have tried/seen have problems regarding security / mis-use as mail-relay.

#5 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 15 May 2007 - 01:34 PM

You might want to investigate integrating the PhpMailer class into your code... I have used it with several installs and we might integrate it into the Cocoon code base...

#6 espersen

    Etomite Forum Fan

  • Member
  • Pip
  • 144 posts

Posted 15 May 2007 - 08:10 PM

Thanks - I guess that the kmail snippet is suitable - but it also needs some modifications... ;o)

#7 Matt007

    Etomite Forum Newbie

  • Member
  • 3 posts

Posted 20 May 2007 - 11:20 PM

Where do I upload it? How do I install it?

#8 svteg

    Etomite Forum Newbie

  • Member
  • 2 posts

Posted 11 June 2007 - 07:50 AM

I want to add this form to a website I'm working on, I don't get any nasty errors until I'm getting to the receive email point. I have the following elements in the form:

Name:
First name:
Adress:
Postcode:
City:
Telephone: not required
Email: not required

I removed the text-box, check box and company thing..

I'm dutch, the site is dutch.. so I changed all the english words to dutch, only the code for email stays the same.

I don't get any send errors, but when I receive the mail it doesn't print the info I filled in.. so I receive a mail like this (in dutch)

Achternaam: ---blank---
Voorletters: ---blank---
Adres: ---blank---
Postcode: ---blank---
Woonplaats: ---blank---
Telefoonnummer: ---blank---
Email: mytestemail@yo.nl

So, it's only printing the email. I'm not surprised, because that's the only original code I used. I'm missing something to print the mail correctly.. but what?

Edit: I solved the problem.. I deleted some lines that were necessary.

Edited by svteg, 19 June 2007 - 09:12 PM.


#9 RobNelson

    Etomite Forum Newbie

  • Member
  • 3 posts

Posted 19 June 2007 - 11:14 AM

Falling at the first fence!

Its my first week with Etomite and I'm on a tight learning curve with PHP!

I'm trying to make a simple inquiry snippet so I thought I would start with this one. I create a ne snippet, cut and paste the cose and when I save the snippet I get:


Not Acceptable
An appropriate representation of the requested resource /manager/index.php could not be found on this server.



Apache/1.3.37 Server at www.rcracetimes.com Port 80

What is this all about!

#10 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 19 June 2007 - 01:13 PM

View PostRobNelson, on Jun 19 2007, 07:14 AM, said:

Falling at the first fence!

Its my first week with Etomite and I'm on a tight learning curve with PHP!

I'm trying to make a simple inquiry snippet so I thought I would start with this one. I create a ne snippet, cut and paste the cose and when I save the snippet I get:
Not Acceptable
An appropriate representation of the requested resource /manager/index.php could not be found on this server.
Apache/1.3.37 Server at www.rcracetimes.com Port 80

What is this all about!
We need more details...

Please supply us with additional information so we can better assist you in resolving this issue... The following information, complete with version/release will be of great help... If the issue is browser-specific also include browsers tested and the results of each...

Etomite Version
Server Operating System
Server Software Version
PHP Version
MySQL Version

#11 Hans

    Likes Etomite Forums!

  • Member
  • PipPip
  • 152 posts

Posted 02 July 2007 - 01:47 PM

Hoi Lloyd
I can't get this snippet to work, especially I can't figure out how to place the snippetcall.
I tried several ways (always with cache off) but no way...
Could you please give me an example of a call where the form is displayed on the page with no specific CSS class?
Thanks in advance.
Hans

#12 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 02 July 2007 - 02:14 PM

View PostHans, on Jul 2 2007, 09:47 AM, said:

Hoi Lloyd
I can't get this snippet to work, especially I can't figure out how to place the snippetcall.
I tried several ways (always with cache off) but no way...
Could you please give me an example of a call where the form is displayed on the page with no specific CSS class?
Thanks in advance.
Hans
As indicated in the snippet code, placing the snippet call [!InquiryForm!] in a document will cause the form to be rendered without using a DIV...

#13 Hans

    Likes Etomite Forums!

  • Member
  • PipPip
  • 152 posts

Posted 02 July 2007 - 02:23 PM

Thanks Ralph
I tried that on a page with a chunck in it and therefor I think it didn't work.
I now placed the snippet on a blank page and it works.
Hans

#14 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 02 July 2007 - 02:43 PM

View PostHans, on Jul 2 2007, 10:23 AM, said:

Thanks Ralph
I tried that on a page with a chunck in it and therefor I think it didn't work.
I now placed the snippet on a blank page and it works.
Hans
As a means of gathering information regarding cached versus non-cached snippet calls, can you try using [[inquiryForm]] in the Chunk and let me know if that works...??? There seems to be some ambiguity regarding how persistent the functionality of the two snippet call methods work in various situations... Your input would be greatly appreciated...

#15 dennus

    Etomite Forum Fan

  • Member
  • Pip
  • 63 posts

Posted 11 August 2007 - 09:19 AM

I have tried using the snippet. I put it all in a empty snippet. When I call it using [!InquryForm!] I get a message saying;

Parse error: syntax error, unexpected T_STRING in /home/users/mysite/www/etomite/index.php(506) : eval()'d code on line 203

Can you tell me what could be the problem?

#16 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 11 August 2007 - 04:12 PM

View Postdennus, on Aug 11 2007, 05:19 AM, said:

I have tried using the snippet. I put it all in a empty snippet. When I call it using [!InquryForm!] I get a message saying;

Parse error: syntax error, unexpected T_STRING in /home/users/mysite/www/etomite/index.php(506) : eval()'d code on line 203

Can you tell me what could be the problem?
Check at or above line 203 in your snippet code to see if there might be a syntax error, possibly caused during Copy & Paste...

#17 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 30 October 2007 - 11:14 AM

Ive tried to install this snippet a number of times also, I am getting the same error message as RobNelson: <a href="http://www.etomite.com/index.php?s=...ost&p=43538" target="_blank">http://www.etomite.com/index.php?s=...ost&p=43538</a>

The error is when trying to save the snippet in the library.

Quote

Not Acceptable
An appropriate representation of the requested resource /manager/index.php could not be found on this server.

This appears in the RHS frame of the Etomite manager: on-click "Manage Resources" the snippet has not saved.

I have narrowed it down to a single line: Without this line, the snippet saves fine. However, this line can not be saved (even by itself and commented out).
LINE 774:
//$headers .= "Bcc: " . $address_2nd . "\r\n";

[EDIT] I have actually narrowed it down to the characters:
Bcc:
[/EDIT]

Is anyone aware of server settings that could effect Etomite's ability to save this code? Or a workaround that lets the user still access the Bcc: feature in the snippet?

I am using cathode's server Eto 0.1.6.4 on LAMP.

Edited by Cris D., 30 October 2007 - 07:36 PM.


#18 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 30 October 2007 - 07:55 PM

For anyone else who has this same problem (can't save this snippet), It looks like the host has introduced mod_security settings that filter bcc: and Bcc:. The only work-around that I can see for anyone experiencing this problem is to remove the Bcc: feature altogether and the rest of the snippet will work fine.

#19 Mr. Tech

    Etomite Forum Fan

  • Member
  • Pip
  • 65 posts

Posted 21 November 2007 - 04:43 PM

I'm wondering if any kind programmer could help me add a quick feature to this form?

Attaching a picture to the Inquiry Form

Have been using this form succesfully for quite a while now and the work-around has been to ask the user to attach a picture and reply to the message. It's not the greatest way to do things and it would be so much easier on visitors to my site to be able to simply click a browse button to select a picture and attach it to the form before clicking the send button.

Appreciate any help I can get...thanks!

#20 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 21 November 2007 - 05:51 PM

View PostMr. Tech, on Nov 21 2007, 11:43 AM, said:

I'm wondering if any kind programmer could help me add a quick feature to this form?
Attaching a picture to the Inquiry Form
<<< SNIP >>>
Well, considering how "attaching an image" and "quick" are almost contradictory terms, the "quick" answer is no... If you were to Google for "image uploads using forms", or something along those lines, you might find enough information to help you with this task... I have written several snippets that rendered forms with images and I wouldn't consider it a simple task even now... In fact I'm currently playing with just such a task at the moment and am tossing several ideas around regarding how to best handle the images themselves...

With a contact or inquiry form you need to be concerned with how the image is handled once it has been selected... Will the image simply be added as an attachment to an email or will it be embedded in the body of the email...??? Will there be a limit on the size of the image selected...??? Will you only allow specific mime types for the images...??? Should the image be resized if it is beyond a certain size...??? Should the image be renamed or use the original name, and if you use the original name will it need to have the name modified to proper cross-platform naming conventions...??? The list goes on...

I guess what I'm getting at is that in order to even begin to provide answers we would need more details regarding what types of images would be uploaded and the intended use of the images... Without at least a small amount of information other than it being an image upload, we can't be of much help - only raise more questions...





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users