Jump to content


Photo

Why Would This Contact Form Stop Working?


  • Please log in to reply
9 replies to this topic

#1 chillspike

chillspike

    Advanced Member

  • Members
  • PipPipPip
  • 221 posts

Posted 25 February 2010 - 05:46 AM

Contact form says "information submitted successfully" but it never arrives at the email.

I haven't change any of the names of the elements associated with the contact form, the php page is set for the right email address too.

Here are both the php script and the submit button script:

php:

<?php

$name = $HTTP_POST_VARS['Name'];
$email = $HTTP_POST_VARS['Email'];
$message = $HTTP_POST_VARS['Message'];

$message = stripslashes($message);

$sendTo = "lisaa4455@gmail.com";
$subject = "Message from Contact Form";

$msg_body = "Name: $name\n";
$msg_body .= "E-Mail: $email\n";
$msg_body .= "Comments: $message\n";

$header_info = "From: ".$name." <".$email.">";

mail($sendTo, $subject, $msg_body, $header_info);

?>

submit button script:

on (release) {
	// =======================================
	// Let's start by assuming they are going
	// to fill in all the fields completely
	// 'innocent until proven guilty'
	// =======================================
	NameValid = true;
	MessageValid = true;
	EmailValid = true;
	// =======================================
	// Now we see what they actually typed
	// =======================================
	Name = userName.text;
	Email = userEmail.text;
	Message = userMessage.text;
	// =======================================
	// Ok, now we sift through the evidence
	// =======================================
	if (Name == "") {
		NameValid = false;
	}
	if (Message == "") {
		MessageValid = false;
	}
	if (Email == "" || Email.indexOf("@") == -1 || Email.indexOf(".") == -1) {
		EmailValid = false;
	}
	// =========================================
	// make sure at least 5 characters are typed
	// =========================================
	
	// =======================================
	// So, if everything checks out - send it!
	// if not, Book 'em Danno!!
	// =======================================
	if (NameValid && EmailValid && MessageValid) {
		loadVariables("contactform.php",'POST');
		Status.text = "Information submitted successfully"
	}
	else {
		if (!NameValid) {
			Status.text = "Please enter your name";
		}
		else if (!EmailValid) {
			Status.text = "Please enter a valid Email address";
		}
		else if (!MessageValid) {
			Status.text = "Please enter your comments";
		}
	}
}

also the script for the tabbing issue that was fixed (could fixing the tabbing have broken the contact form?):

onFrame (215) {
	stop();
}
onFrame (130) {
	stop();
}
onFrame (215) {
	this.lisa.tabEnabled = false;
	this.guitaristsinger.tabEnabled = false;
	this.home.tabEnabled = false;
	this.bio.tabEnabled = false;
	this.photos.tabEnabled = false;
	this.gigs.tabEnabled = false;
	this.contact.tabEnabled = false;
	this.Submit.tabEnabled = false;
	this.Reset.tabEnabled = false;

	Selection.setFocus = (this.userName);
	this.userName.tabIndex = 1;
	this.userEmail.tabIndex = 2;
	this.userMessage.tabIndex = 3;
	stop();
}

swi also attached.

Sorry I'm having so much trouble with this. I'm trying to fix as many as I can myself but I don't know what could be causing this one.

Attached Files

  • Attached File  lisa.swi   1.28MB   17 downloads

Edited by chillspike, 25 February 2010 - 09:48 PM.


#2 januszr

januszr

    Advanced Member

  • Members
  • PipPipPip
  • 804 posts
  • Gender:Male
  • Location:Warsaw, Poland

Posted 25 February 2010 - 06:05 AM

set chmod for *.php to 777
or/and
change
http://www.SITE_ADDRESS/contactform.php
to
contactform.php

or/and

./contactform.php


Depending on server system and/or PHP version it will works ok. Im my case first, few years ago link with "./" was ok, but now I got only "contactform.php" without anything before it.

Edited by januszr, 26 February 2010 - 01:38 AM.


#3 chillspike

chillspike

    Advanced Member

  • Members
  • PipPipPip
  • 221 posts

Posted 25 February 2010 - 06:29 AM

This is absolutely insane! Someone just spammed me twice with emails from that contact form and yet NONE of MY emails from it are getting through! Wtf? :blink:
Unless...they didn't use the contact form...???

Set the permissions to 777.

#4 Zastrozzi

Zastrozzi

    Advanced Member

  • Members
  • PipPipPip
  • 37 posts

Posted 25 February 2010 - 08:49 AM

Could either of you tell me how/where to set chmod to 777? Is it just another line in the php script?

FWIW, chillspike, I'm having a similar experience with almost verbatim the same scripts (including the full URL for contactform.php). No e-mails coming through at all. It's driving me batty!

And thanks, januszr, for these suggestions. I'll give them a try and report back.

#5 chillspike

chillspike

    Advanced Member

  • Members
  • PipPipPip
  • 221 posts

Posted 25 February 2010 - 08:58 AM

You don't set permissions in the file...When you click on the file at your host, there will be choices like "Edit". "Delete", etc...There will also be a "Change Permissions" option...Click on that and tick off all the boxes until it says 777.

Tried both ./contactform.php and contactform.php

Neither is working right now.

It was working 3 days ago with contactform.php

I'm guessing that once the tabbing issue was fixed by gsmall, any editing I did broke it. But I didn't edit the contact form elements.

Edited by chillspike, 25 February 2010 - 09:48 AM.


#6 januszr

januszr

    Advanced Member

  • Members
  • PipPipPip
  • 804 posts
  • Gender:Male
  • Location:Warsaw, Poland

Posted 25 February 2010 - 07:08 PM

TabIndex shouldnt have any impact on php. Maybe You didnt copy VAR values from original or 3 days ago You retyped text (such as "userName") mrked as target? Try to compare with original ContactForm version.
Are you sure that 3 days ago your space provider didnt made any updates of PHP?
Last idea I got is possibility of accidental chage of the letters and/or case sensitivity of the server.

Attached Files


Edited by januszr, 25 February 2010 - 07:15 PM.


#7 chillspike

chillspike

    Advanced Member

  • Members
  • PipPipPip
  • 221 posts

Posted 25 February 2010 - 09:52 PM

TabIndex shouldnt have any impact on php. Maybe You didnt copy VAR values from original or 3 days ago You retyped text (such as "userName") mrked as target? Try to compare with original ContactForm version.
Are you sure that 3 days ago your space provider didnt made any updates of PHP?
Last idea I got is possibility of accidental chage of the letters and/or case sensitivity of the server.



I'll have to ask my host later today.

In the meantime, januszr, could you by any chance remove the reference to the website in the code you quoted from of your post(s)?

Just realized my friend probably wouldn't want technical issues related to her site indexed by search engines. Not your fault. Mine as I shouldn't have used her domain name in the code. Thanks!

#8 chillspike

chillspike

    Advanced Member

  • Members
  • PipPipPip
  • 221 posts

Posted 26 February 2010 - 01:01 AM

I found out why my contact form isn't working. Emailed my host asking if they changed anything. This is their response;

"We have disabled simple php mail function to send emails from forms.
You have to use smtp function to send emails through form rather that simple php mail function. This is a new function in all servers to protect from spam."


How do I use smtp?

@Zastrozzi,

You might want to contact your host and ask them if they disabled the simple php mail function.

Edited by chillspike, 26 February 2010 - 01:24 AM.


#9 januszr

januszr

    Advanced Member

  • Members
  • PipPipPip
  • 804 posts
  • Gender:Male
  • Location:Warsaw, Poland

Posted 26 February 2010 - 01:45 AM

website link removed.

#10 chillspike

chillspike

    Advanced Member

  • Members
  • PipPipPip
  • 221 posts

Posted 26 February 2010 - 05:59 AM

website link removed.



Thanks, januszr




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users