cloudy

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

0 Members and 2 Guests 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 #90 on: August 26, 2008, 02:20:04 AM »
I wonder if you use getenv instead of env
like this


Code: [Select]
// Where have we been posted from?
 if( isset($_SERVER['HTTP_REFERER']) and trim($_SERVER['HTTP_REFERER']) != '' ) {
    $fromArray = parse_url(strtolower($_SERVER['HTTP_REFERER']));
 }else if ( isset(getenv('HTTP_REFERER')) ){
    $fromArray = parse_url(strtolower( getenv('HTTP_REFERER') ));
 } else if ($domain_protect) {
    return 3; // bail out
 }

Offline ALITTLEweird1

  • Mark
  • Posts: 3,984
  • Snoqualmie,WA
    • Snoqualmie Weather
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #91 on: August 26, 2008, 02:26:02 AM »
I'll try that...just  a sec..........


« Last Edit: August 26, 2008, 02:35:36 AM by ALITTLEweird1 »
"Nature can do without man, but man cannot do without nature."

Davis VP2 + 1-Wire Solar + 1-wire Lightning + 1-Wire UV + Logitech Webcam

Offline ALITTLEweird1

  • Mark
  • Posts: 3,984
  • Snoqualmie,WA
    • Snoqualmie Weather
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #92 on: August 26, 2008, 02:35:48 AM »
Update: Nope....getting the same error as the last time.
"Nature can do without man, but man cannot do without nature."

Davis VP2 + 1-Wire Solar + 1-wire Lightning + 1-Wire UV + Logitech Webcam

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 #93 on: August 26, 2008, 02:37:27 AM »
sorry i did have an error in there afterall

try this

Code: [Select]
   
  // Where have we been posted from?
   if( isset($_SERVER['HTTP_REFERER']) and (trim($_SERVER['HTTP_REFERER']) != '') ) {
      $fromArray = parse_url(strtolower($_SERVER['HTTP_REFERER']));
   } else if( getenv('HTTP_REFERER') != '' ) {
      $fromArray = parse_url(strtolower( getenv('HTTP_REFERER') ));
   } else {
      return 3; // bail out
   }

Offline ALITTLEweird1

  • Mark
  • Posts: 3,984
  • Snoqualmie,WA
    • Snoqualmie Weather
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #94 on: August 26, 2008, 02:48:24 AM »
OK...using that code... My page does load normal now. But when i hit submit with or without entering any data into the form i get " Input Forbidden"
"Nature can do without man, but man cannot do without nature."

Davis VP2 + 1-Wire Solar + 1-wire Lightning + 1-Wire UV + Logitech Webcam

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 #95 on: August 26, 2008, 02:49:46 AM »
do you know what version of PHP you have?

Offline ALITTLEweird1

  • Mark
  • Posts: 3,984
  • Snoqualmie,WA
    • Snoqualmie Weather
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #96 on: August 26, 2008, 02:55:07 AM »
Version 5
"Nature can do without man, but man cannot do without nature."

Davis VP2 + 1-Wire Solar + 1-wire Lightning + 1-Wire UV + Logitech Webcam

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 #97 on: August 26, 2008, 03:09:30 AM »
This is really hard for me to debug with "try this, try that" method.
Would you be able to give me a test ftp account?

Offline ALITTLEweird1

  • Mark
  • Posts: 3,984
  • Snoqualmie,WA
    • Snoqualmie Weather
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #98 on: August 26, 2008, 03:13:43 AM »
Never done that....what do i need to do to give you that?
"Nature can do without man, but man cannot do without nature."

Davis VP2 + 1-Wire Solar + 1-wire Lightning + 1-Wire UV + Logitech Webcam

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 #99 on: August 26, 2008, 03:18:31 AM »
does your server have a control panel where you can add a user?
I will not be able to tell you how because I do not use IIS

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 #100 on: August 26, 2008, 04:05:25 AM »
Updated

Version: 1.13 - 25-Aug-2008
Fix for handling a blank HTTP_REFERER (a rare condition) in host name check when $domain_protect is enabled

Online Budgie

  • Martin
  • Global Moderator
  • Posts: 4,957
  • WML Station: WD00934 CWOP: CW7959
  • Isle of Lewis, Scotland
    • Hebrides-Weather
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #101 on: August 26, 2008, 09:27:53 AM »
Mike,
I'll email full details of this one as it's a bit complicated for me to explain from work but; can your forms be made to work with ASP email as the server I'm trying to get these working on doesn't have a PHP mailserver installed, but does have ASP?

Cheers,

Martin.

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 #102 on: August 26, 2008, 02:40:26 PM »
Martin,

Are you sure PHP cannot mail from your server?
Have you tried my script? was there an error?

It will not hurt anything to try it. This script checks that PHP mail function is enabled or not and will show an error if it is not enabled.
"ERROR: Enviromental Error: The PHP mail() function is not enabled"

PHP mail command uses the server MTA (Mail Transport Agent) what ever it is. My server has qmail (a Linux program), the PHP mail function sends the mail to qmail and then qmail sends it to me.


Online Budgie

  • Martin
  • Global Moderator
  • Posts: 4,957
  • WML Station: WD00934 CWOP: CW7959
  • Isle of Lewis, Scotland
    • Hebrides-Weather
Re: Free Contact Form PHP Script with image captcha - contact.php
« Reply #103 on: August 26, 2008, 03:52:46 PM »
I have tried it and it does show an error but it's this one for the Contact form:

Quote
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\Web_Sites\Torro_org_uk\www\site\contact.php on line 474

The other one is a redesign of the SCWN Join.php which I'm wanting to use as a Membership Application form but that's giving me:
Quote
Fatal error: Call to undefined function getmxrr() in D:\Web_Sites\Torro_org_uk\www\site\membership.php on line 648

I can't use the Captcha coding as the server isn't set to recognise the gdfont that's used.
The server is a dedicated server that seems to be privately owned, fortunately I do have contact with the guy who runs it. I've got the PHP specs for the site and I can PM or email the URL's to you once I get home from work if that helps?  They do show that the SMTP is disabled though.

I know this is a server problem as both forms work fine on the hosted server that I use.
If you want to test either form then the membership form is set to my own email address and just pick "Martin Collins" or "Webmaster" from the dropdown on the Contact form.

Cheers

Martin.
« Last Edit: August 26, 2008, 03:56:20 PM by Budgie »

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 #104 on: August 26, 2008, 04:59:00 PM »
Martin,

download the join form zip file again, I fixed the getmxrr() two versions ago
http://www.642weather.com/weather/scripts/join-form.zip

You can try this to get the contact form to mail via SMTP
if it works, let me know.

If you have a windows IIS server it might no like the sendmail path though...

You can try to make it send by SMTP
You have to put this code in the php script near where the config settings are.
a good place would be just after  $ctf_encoding = 'quoted-printable';

Code: [Select]
// If mail is not sending on your host, You can try to make it send by SMTP
// NOTE most servers do not need this, so skip this section unless this is your last resort
$ctf_ini_set       = "yes";       // Or "yes" (if needed)
$ctf_smtp          = "localhost"; // Confirm with your host
$ctf_smtp_port     = "25";        // Confirm with your host
$ctf_smtp_username = "admin";     // your mail username. If you do not know, ask your host
$ctf_smtp_password = "123456";    // your mail password. If you do not know, ask your host
$ctf_sendmail_from = "you@yourdomain.com";   // Your email
$ctf_sendmail_path = "/usr/sbin/sendmail -t -i"; // If different, ask host


if(strtolower($ctf_ini_set) == "yes") {
    ini_set("SMTP", $ctf_smtp);
    ini_set("smtp_port", $ctf_smtp_port);
    ini_set("smtp_password", $ctf_smtp_password);
    ini_set("smtp_username", $ctf_smtp_username);
    ini_set("sendmail_from", $ctf_sendmail_from);
    ini_set("sendmail_path", $ctf_sendmail_path);
}


« Last Edit: October 28, 2008, 06:44:15 PM by MCHALLIS »

 

cumulus