advice on contact form

pernin / 2011-05-13 03:44:23   

Hi all,

I'm helping a friend build her website, melissahenderson.co.uk, and she wishes to have some sort of simle contact form so that readers can, well, contact her to be added to her mailing list.

I've been searching the forum for other solutions.

I'd be very grateful for your advice, before I do anything with this. Is there anyone who has had experience of this customization, or some other solution? Mostly worried about spam security...

Cheers, Alfredo Pernin

Vaska A / 2011-05-13 03:58:34   

I doubt that is very solid - been plenty of issues with the code over there.

Let me see if I can find the one I built awhile back - it did have some good security but it wasn't 100% finished.

And thanks for all your extra help lately. ;)

Vaska A / 2011-05-13 04:01:36   

Ah, I do have it. But let me look over it a little later today and then I'll post it up.

It needs some validation on the message inputs before it's usable.

pernin / 2011-05-13 04:09:04   

Great! thanks Vaska! -- it's my pleasure to help out, any way I: indexhibit is a great cms, by far the best I've seen for visual artists :-)

pernin / 2011-05-13 04:34:31   

I think faster than I type, or viceversa :-P I meant *any way I can

Vaska A / 2011-05-13 11:38:17   

Download: Contact Form

- unzip and put in your /ndxz-studio/site/plugin/ folder.
- edit the file with YOUR email address and SUBJECT line.
- insert into whichever exhibit you want:

  1. <plug:contact_form />

Give it a test and let me know how it goes.

This is pretty quick work. I could spend alot more time adding features and things but this should be good enough to get you rolling.

Vaska A / 2011-05-13 11:39:58   

You might want to style it up - if you crack open the file you will see the chunk of html that drives things...should be easy to deal with the CSS.

pernin / 2011-05-14 02:26:09   

Thanks Vaska! mmm... could you please check the link? the file is only 14 bytes and contains just the line 'page not found'

Vaska A / 2011-05-14 06:27:00   

It's fixed. Hosting issue I had to blab about... ;)

pernin / 2011-05-14 08:03:51   

thanks!! looks great, I'll test it later today :-)

adega / 2011-05-14 13:23:04   

I get this error:
Fatal error: Class 'Contact' not found in /homez.420/orppo/www/ndxz-studio/site/plugin/plugin.contact_form.php on line 5

Any tips??

Thanks!!

pernin / 2011-05-14 13:27:34   

just started testing the plugin, and as adega says, i also get the same error, in line 5, where it references $Contact and doesn't find the class

Vaska A / 2011-05-14 14:58:34   

Ummm...woops. Well, I had to make some edits because it's being written on another version of Indexhibit that's not out yet...soooooo...you can change the first few lines to this...

  1. function contact_form()
  2. {
  3.     $CONTACT = new Contact;
  4.     $CONTACT->output();
  5. }
  6. class Contact

Changiong the class name will do the trick. Sorry for the mixup...

pernin / 2011-05-14 15:56:33   

I made an installation to test it but there's still an error, sorry for the hassle ;-)

indextest.bagofcats.net

  1. error message:
  2. Fatal error: Cannot redeclare contact_form() (previously declared in /storage/content/51/119151/indextest.bagofcats.net/public_html/ndxz-studio/site/plugin/plugin.email_form.php:134) in /storage/content/51/119151/indextest.bagofcats.net/public_html/ndxz-studio/site/plugin/plugin.contact_form.php on line 7
pernin / 2011-05-14 16:03:00   

blimey, my wrong, had to clear the cache. testing now...

pernin / 2011-05-14 16:18:46   

nope, nothing happens...

adega / 2011-05-14 21:09:46   

Still not working here...

I guess if i ask about new version i will be ignored as always yep?? :)

pernin / 2011-05-15 03:09:53   

having been a developer myself (sometime in the fog of prehistory, er... twenty years ago) I fully understand and admire Vaska and the indexhibit team... the new version will come when it comes, just like summer... patience, and a long beard, helps ;-)

Vaska A / 2011-05-15 04:54:12   

Pernin...maybe you can find me on AIM/iChat and we'll see what we can do?

I'm around for a little while today...

AIM: Indexhibit

pernin / 2011-05-15 05:30:23   

'K, will do :-)

Vaska A / 2011-05-15 05:38:55   

When I get a chance I'll swap the file with the change, but I forgot to 'return' the data. So, the beginning of the file should look like this (after the php)...

  1. function contact_form()
  2. {
  3.     $CONTACT = new Contact;
  4.     return $CONTACT->output();
  5. }
  6. class Contact
  7. {
pernin / 2011-05-15 14:42:36   

KK, great work Vaska!! And thanks again!!

I've set it up at my friend's website now (melissahenderson.co.uk) and she's delighted -- and I'm getting a cake next time she visits :-)

adega / 2011-05-15 18:10:34   

Lucky man then, here it seems like the message is sent but is not really, the mail never appears reaches....

pernin / 2011-05-16 02:13:22   

One more last change to make to the plugin -- Vaska forgot to name it here, but as he says, he'll refresh the file in the download link:

after the 'return' one, at about line 23 or something, change contact_form to Contact

buena suerte :-)

adega / 2011-05-16 16:23:31   

You are great dude...working perfectly fine now!! thanks to Vaska again/too,

Gracias amigo ;)

Vaska A / 2011-05-16 16:54:47   

Ah great. I was afraid the headers weren't good enough as I did the bare minimum. I'll add some more and then update it...

ninad / 2011-09-06 11:41:55   

Hello all,

I am a new user of Indexhibit. While I have minimal experience with coding, I find that some patience and some of trial&error has made it possible for me to create a good looking website:

www.sp-am.org

I have been trying to get the contact form working, but have failed so far. I got the code posted by Vaska above, and made the changes in the file (changed the class contact part and added "return" and so forth, as well as changed the destination email address and the subject line).

The resulting contact form can be found here:

http://www.sp-am.org/contact/

However, the email never sends. Are there any other changes I should make? Any help will be greatly appreciated!
Thanks!

blighty / 2011-09-18 14:43:15   

Hi there

I am also trying to create a contact form. I have followed the instructions of downloading the contact form:

Download: Contact Form

- unzip and put in your /ndxz-studio/site/plugin/ folder.
- edit the file with YOUR email address and SUBJECT line.
- insert into whichever exhibit you want:

I then edited the data where necessary:
function contact_form()
{
$CONTACT = new Contact;
return $CONTACT->output();
}
class Contact
{

However, I still get the following message ( see below ) I up-loaded via the' file manager' option and selecting the link but this wasn't from my FTP. Any advice you be much appreciated. Many thanks

Parse error: syntax error, unexpected '}', expecting '{' in /var/www/vhosts/laurablight.co.uk/httpdocs/ndxz-studio/site/plugin/plugin.contact_form (18:09:2011 20:25).php on line 10

www.laurablight.co.uk

pernin / 2011-09-18 15:04:15   

check the plugin where you edited it (we can't see it from here): you may have either deleted or added an extra brace { or } on line 10?

if you can't find the error, just download again and repeat the process

blighty / 2011-11-14 12:59:27   

Hi Pernin

Thank you for your response.

I'm still having trouble though. I have added iframed.php plugin and contact form to /ndxz-studio/site/plugin/ folder.

Do I then just add a new exhibit and copy and paste ?

Many thanks

pernin / 2011-11-14 13:16:28   

as it says in Vaska's post, just put in the edit area of the page:
<plug:contact_form />

and don't forget to check that all the edits mentioned in the posts above have been made. read through, everything is here

blighty / 2011-11-14 13:32:06   

Okay, thank you for your help.

blighty / 2011-11-19 02:59:54   

Hi Pernin

My contact form now appears on indexhibit however, when I tested it I didn't get an e-mail back in my inbox? Can you advise why this might be?

Many thanks

Laura

http://www.laurablight.co.uk

pernin / 2011-11-19 03:59:15   

Hi Laura,

it's failing on several counts, but I can't see the php code, so it's difficult for me to say -- but more than one thing is broken in the file. Could you contact me through http://index.bagofcats.net/contact/ with the email address you want in your contact form? The I'll just send you back a correctly edited file.

virtualnao / 2011-12-05 07:49:59   

Hello!

First I want to say thanks for making the plugin, it was easy to put into place on my site.

The only issue I have with it is the send button says, "Submit Query." How would I go about changing that?

Thanks.

pernin / 2011-12-05 08:04:07   

It will be 'Submit Query' or just 'Submit', depending on the browser. There's a small detail missing in the plugin. At about line 45, this line needs a 'value', for example if you want 'Send':

$html .= "<div><input type='submit' name='submitted' value='Send' class='a-submit' />n";

virtualnao / 2011-12-05 08:35:13   

What a simple fix. Thanks so much!

samevansbutler / 2012-01-29 18:45:48   

I have read the entire thread, but am still having trouble.

Downloaded, entered my own address, changed "Contact_Form" to "Contact"...

...a little unclear about what else to change, something with return?

The very act of copying the php file to my plugin folder crashes my site and causes it to display:

Fatal error: Cannot redeclare contact_form() (previously declared in /hermes/web11/b2262/moo.samevansbutlercom/ndxz-studio/site/plugin/plugin.email_form.php:95) in /hermes/web11/b2262/moo.samevansbutlercom/ndxz-studio/site/plugin/plugin.contact_form.php on line 7

Help please.

samevansbutler / 2012-01-29 18:46:01   

I have read the entire thread, but am still having trouble.

Downloaded, entered my own address, changed "Contact_Form" to "Contact"...

...a little unclear about what else to change, something with return?

The very act of copying the php file to my plugin folder crashes my site and causes it to display:

Fatal error: Cannot redeclare contact_form() (previously declared in /hermes/web11/b2262/moo.samevansbutlercom/ndxz-studio/site/plugin/plugin.email_form.php:95) in /hermes/web11/b2262/moo.samevansbutlercom/ndxz-studio/site/plugin/plugin.contact_form.php on line 7

Help please.

samevansbutler / 2012-01-29 18:46:49   

Sorry 'bout the double post.

pernin / 2012-01-30 02:30:44   

@samevansbutler: where?

samevansbutler / 2012-01-30 07:21:26   

samevansbutler.com

pernin / 2012-01-30 07:50:30   

I see neither contact form nor error... where?

samevansbutler / 2012-01-30 08:07:50   

Oh, it's not implemented because at the moment I am trying to keep my site offline until it is ready, so I only turn things on to test them out. Also, it crashes the site.

Here, I'll put it back so you can take a look.

pernin / 2012-01-30 08:26:32   

what is this plugin.email_form.php? it's creating a conflict with plugin.contact_form.php -- you can't have both. Delete the plugin.email_form.php and see if that fixes it

samevansbutler / 2012-01-30 08:31:18   

That was from an earlier version of a contact form I tried before I found Vaska's. That fixed the error message, but the actual contact form doesn't show up on the contact page.

What am I missing here?

pernin / 2012-01-30 08:43:16   

are you calling the plugin in the text area of the contact page?

<plug:contact_form />

samevansbutler / 2012-01-30 08:46:28   
yes. should it be just
pernin / 2012-01-30 08:49:14   

exactly as I wrote it

samevansbutler / 2012-01-30 08:59:20   
sorry, last bit got deleted. Was asking if it should be because I remember something about changing that inside the PHP on one of Vaska's posts, but had what you typed, tried the other way I just mentioned and have put it back to what you said...

nothing works. :-(

This thread has been closed, thank you.