cloudy

Author Topic: Free Contact Form PHP Script with image captcha - OLD VERSION  (Read 40546 times)

0 Members and 1 Guest are viewing this topic.

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #15 on: August 14, 2008, 03:39:50 AM »
Not all systems are the same.. my test on my server all came out OK.
Sorry you are having trouble. It might be easy for me to fix.

Those having trouble can you tell me what version of PHP, is your server linux or windows?
Does it do it every time?
Do you know what MTA the server uses? qmail, sendmail
If you do not know all the answers, that is OK.

« Last Edit: August 14, 2008, 05:15:45 AM by MCHALLIS »

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #16 on: August 14, 2008, 05:14:04 AM »
I'm getting the following error when I test the contact.php script:

Warning: mail(): Bad parameters to mail() function, mail not sent. in /home/content/d/a/f/dafuser/html/wx/contact.php on line 394

Message Sent

Your message has been sent, thank you.

I'm guessing I have some part of the configuration wrong, but don't see what it is.

Can you try this:

Change:
Code: [Select]
$subj = "$sitename contact: $subject" . PHP_EOL;

to:
Code: [Select]
$subj = "$sitename contact: $subject";

I am pretty sure the subject line does not need the EOL.

Let me know if that fixes it?

I fixed it in the zip file so if anybody else wants to try it go ahead.
« Last Edit: August 14, 2008, 05:49:36 AM by MCHALLIS »

Offline NorCal Dan

  • -= Dan =-
  • Posts: 9,438
  • Davis Vue/iMac/Parallels/WinXP
  • Marysville, California
    • Skype @ KJ6RGX
    • Traveling RV Weather
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #17 on: August 14, 2008, 02:05:30 PM »
 :oops:

I use gmail and I discovered that the subject is being sent in the header information and not the body of the message.  I didn't see it because the header information is suppressed when I view the message unless I manually click for the header information.  FWIW, I  removed the EOL from the subject line and the contact form still worked ok here.  Also, I checked my older test messages I sent to myself and they all had the subject line in the header information.

I guess I was expecting the subject line between the To: Webmaster line and the From: line in the message body.  Silly me...

Offline NorCal Dan

  • -= Dan =-
  • Posts: 9,438
  • Davis Vue/iMac/Parallels/WinXP
  • Marysville, California
    • Skype @ KJ6RGX
    • Traveling RV Weather
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #18 on: August 14, 2008, 02:10:34 PM »
I'm getting the following error when I test the contact.php script:

I wanted to see the error to ensure I wasn't getting the same thing.  I saw the error your getting and I do not get that with my contact form v1.08.  Did you actually receive the test message I sent?

I see you have your contact form external from your regular site.  If you need help getting it integrated let me know...

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #19 on: August 14, 2008, 02:46:49 PM »
I wanted to see the error to ensure I wasn't getting the same thing.  I saw the error your getting and I do not get that with my contact form v1.08. 

Sometimes a host will have PHP 'errors and warnings', or just 'warnings' turned off so as not to reveal server information when a error happens.
If you want put make sure PHP will show you all 'errors and warnings' for this script then un-comment this on (about line 83):
error_reporting( E_ALL );

Then it will show any warnings like "Warning: mail(): Bad parameters to mail() function, mail not sent."
After you test the form for awhile, you can comment that line again.

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #20 on: August 14, 2008, 08:06:26 PM »
anybody else want to try this?

Offline daveq

  • Posts: 3,098
  • Hollywood, MD
    • Hollywood - St. Mary's County, Maryland
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #21 on: August 14, 2008, 09:01:10 PM »
Mike, I updated to the latest and am having no problems.  I turned on the error reporting but nothing shows as I guess would be expected.

How do most people get back to the home page?  I guess the only way is using the back button on the browser.  Would it be useful to have a 'return to home page' link??

--Dave

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #22 on: August 14, 2008, 09:29:05 PM »
Mike, I updated to the latest and am having no problems.  I turned on the error reporting but nothing shows as I guess would be expected.

How do most people get back to the home page?  I guess the only way is using the back button on the browser.  Would it be useful to have a 'return to home page' link??

--Dave

Thanks dave, I think it is fixed now.

I run the script inside my site template
http://www.642weather.com/weather/contact_us.php
After the mail it send, my side menu has all the site links.

You can integrate it into your site template also if you want.

If you want to just run it standalone you can edit the config variable $thank_you and add any links you need.

Code: [Select]
// The $thank_you is what gets printed after the form is sent.
 $thank_you = <<<EOT

 <h1>Message Sent</h1>

 <p align="left">
    Your message has been sent, thank you.
 </p>

EOT;
// do not remove the above EOT line

« Last Edit: October 28, 2008, 06:41:22 PM by MCHALLIS »

Offline daveq

  • Posts: 3,098
  • Hollywood, MD
    • Hollywood - St. Mary's County, Maryland
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #23 on: August 14, 2008, 09:56:33 PM »
Thanks, Mike.  I've been putting off upgrading to the fly-out menu but looks like it's time.  Contacts would look better inside the template.

--Dave

Offline dafuser

  • Posts: 561
  • Granbury, Texas
    • Weather from the shores of Lake Granbury
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #24 on: August 15, 2008, 12:32:30 AM »
Can you try this:

Change:
Code: [Select]
$subj = "$sitename contact: $subject" . PHP_EOL;

to:
Code: [Select]
$subj = "$sitename contact: $subject";

I am pretty sure the subject line does not need the EOL.

Let me know if that fixes it?

I fixed it in the zip file so if anybody else wants to try it go ahead.
Yep, that fixed it, works fine. Thanks for the help and the nice script.
--
Thanks Les...
Microsoft Windows: Proof that P.T. Barnum was correct.

24 inch iMac 2.8GHz C2D, 4 GB Ram (OS X 10.7 Lion) Davis Vantage Vue

Offline NorCal Dan

  • -= Dan =-
  • Posts: 9,438
  • Davis Vue/iMac/Parallels/WinXP
  • Marysville, California
    • Skype @ KJ6RGX
    • Traveling RV Weather
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #25 on: August 15, 2008, 03:24:15 AM »
Thanks, Mike.  I've been putting off upgrading to the fly-out menu but looks like it's time.  Contacts would look better inside the template.

It looks very nice when used inside the templates, you can see mine here.


add: I also enabled the error reporting but am not getting any errors, good news I reckon...
« Last Edit: August 15, 2008, 03:27:53 AM by NorCal Dan »

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #26 on: August 15, 2008, 04:27:00 AM »
Dan and dafuser

your contact forms do not have the css code that goes in the <head></head>
Look at step #4 of the readme.txt inside the zip file.
« Last Edit: August 15, 2008, 04:29:14 AM by MCHALLIS »

Offline dafuser

  • Posts: 561
  • Granbury, Texas
    • Weather from the shores of Lake Granbury
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #27 on: August 15, 2008, 10:48:59 AM »
Dan and dafuser

your contact forms do not have the css code that goes in the <head></head>
Look at step #4 of the readme.txt inside the zip file.

I have put the form into the site templates and set it so itcomes up when the Contact Us link in the footer is clicked on. I believe I have it setup correctly now, it looks good. In the site template.
--
Thanks Les...
Microsoft Windows: Proof that P.T. Barnum was correct.

24 inch iMac 2.8GHz C2D, 4 GB Ram (OS X 10.7 Lion) Davis Vantage Vue

Offline daveq

  • Posts: 3,098
  • Hollywood, MD
    • Hollywood - St. Mary's County, Maryland
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #28 on: August 15, 2008, 10:51:56 AM »
It looks very nice when used inside the templates, you can see mine here.

Yup, I agree.  I looked at Mike's and that convinced me I needed it inside the template.  I just didn't want to add another button to the navigation and linked it as a standalone from the Contact Us in the footer.  Didn't cross my mind until now that I could create a new template page and then link it from there.  Dooh!  That's what happens to the web challenged.

--Dave

Offline daveq

  • Posts: 3,098
  • Hollywood, MD
    • Hollywood - St. Mary's County, Maryland
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #29 on: August 15, 2008, 01:11:19 PM »
Got it integrated into my template but another but...

When I click submit I get what appears to be a basic html page that has the Thank you message sent stuff.  Page source shows this below the css code:

Quote

</head>
<body>

<!-- To add into your own page TRIM beginning here -->

<div id="contactform">

<h1>Contact Us</h1>


 <h1>Message Sent</h1>

 <p align="left">

    Your message has been sent, thank you.
 </p>

<!-- To add into your own page TRIM ending here -->

</body>
</html>

I haven't tried other pages because I don't want to be a bother but I doubt others have the same happen.  I must have not copied the correct info into the template or... it's in the wrong place.

I hate to show my ignorance but my wxcontact page is attached.  :oops:

--Dave