Web Design Forum: My Contact Form v1.9 - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

My Contact Form v1.9 Rate Topic: -----

#41 User is online   AndyDesigns 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 240
  • Joined: 13-September 10
  • Reputation: 5
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 07 November 2010 - 12:42 AM

View Postwebdesigner93, on 07 November 2010 - 12:13 AM, said:

Ok i found ur prob i think u need to name this input field submit
<input type="submit" value="Submit"> 
so it should look like this
<input type="submit" name="submit" value="Submit">
otherwise it will keep redirecting back to contact.html


Thanks for the reply, made that change and now getting this error:

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampplite\htdocs\Andys portfolio\mail_send.php on line 141
We can not send the email at this time please try again later!
0

#42 User is offline   webdesigner93 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,858
  • Joined: 22-September 09
  • Reputation: 212
  • Gender:Male
  • Experience:Web Guru
  • Area of Expertise:Web Developer

Posted 07 November 2010 - 12:47 AM

View Postweb-apprentice, on 07 November 2010 - 12:42 AM, said:

Thanks for the reply, made that change and now getting this error:

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampplite\htdocs\Andys portfolio\mail_send.php on line 141
We can not send the email at this time please try again later!

Is this from localhost like xammp or online?

EDIT: Nevermind i can see its xammp, well in order to send mail from there ur gonna have to set it up in php.ini or u can just save it the trouble and try it live :)
0

#43 User is online   AndyDesigns 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 240
  • Joined: 13-September 10
  • Reputation: 5
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 07 November 2010 - 01:29 AM

View Postwebdesigner93, on 07 November 2010 - 12:47 AM, said:

Is this from localhost like xammp or online?

EDIT: Nevermind i can see its xammp, well in order to send mail from there ur gonna have to set it up in php.ini or u can just save it the trouble and try it live :)


Thankyou it is now working great from live domain, except i'm not getting the "your email has been successfully sernt" message even though it HAS sent it.
0

#44 User is offline   webdesigner93 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,858
  • Joined: 22-September 09
  • Reputation: 212
  • Gender:Male
  • Experience:Web Guru
  • Area of Expertise:Web Developer

Posted 07 November 2010 - 01:59 AM

View Postweb-apprentice, on 07 November 2010 - 01:29 AM, said:

Thankyou it is now working great from live domain, except i'm not getting the "your email has been successfully sernt" message even though it HAS sent it.


Is the page just blank?
0

#45 User is online   AndyDesigns 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 240
  • Joined: 13-September 10
  • Reputation: 5
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 07 November 2010 - 01:02 PM

View Postwebdesigner93, on 07 November 2010 - 01:59 AM, said:

Is the page just blank?


It just seems to redirect back to the contact page but obviously the form fields are then empty.
0

#46 User is offline   webdesigner93 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,858
  • Joined: 22-September 09
  • Reputation: 212
  • Gender:Male
  • Experience:Web Guru
  • Area of Expertise:Web Developer

Posted 07 November 2010 - 03:12 PM

View Postweb-apprentice, on 07 November 2010 - 01:02 PM, said:

It just seems to redirect back to the contact page but obviously the form fields are then empty.

But u said the emails being sent?
0

#47 User is online   AndyDesigns 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 240
  • Joined: 13-September 10
  • Reputation: 5
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 07 November 2010 - 03:17 PM

View Postwebdesigner93, on 07 November 2010 - 03:12 PM, said:

But u said the emails being sent?


Please ignore my last post, for some reason, lastnight the success message wasnt showing, but today it is!!
Can I add my header, footer, div layout and CSS to the success page too?

Thankyou again for all your help!
0

#48 User is offline   webdesigner93 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,858
  • Joined: 22-September 09
  • Reputation: 212
  • Gender:Male
  • Experience:Web Guru
  • Area of Expertise:Web Developer

Posted 07 November 2010 - 03:24 PM

View Postweb-apprentice, on 07 November 2010 - 03:17 PM, said:

Please ignore my last post, for some reason, lastnight the success message wasnt showing, but today it is!!
Can I add my header, footer, div layout and CSS to the success page too?

Thankyou again for all your help!


Yes u can add html style anything u like just as long as u keep the redirect at the top of the page before any html ect.. other then that u can put the html tags ect.. below that redirect if u need help let me know
0

#49 User is online   AndyDesigns 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 240
  • Joined: 13-September 10
  • Reputation: 5
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 07 November 2010 - 03:44 PM

View Postwebdesigner93, on 07 November 2010 - 03:24 PM, said:

Yes u can add html style anything u like just as long as u keep the redirect at the top of the page before any html ect.. other then that u can put the html tags ect.. below that redirect if u need help let me know


Sorry to be a pain, ive tried adding my html where i thought it should go but im getting php errors again now:

Parse error: syntax error, unexpected '<' in /home/topulfql/public_html/mail_send.php on line 140

Could you take a look at my code, i'm obviously doing it completely wrong :/

<?php
/*
Rizo Contact Form Mailer v1.9-- is a free and secure form mailer that you may
use for your website.
(C) Copyright Steve Morgan 2010 all rights reserved.


This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

To read the GNU General Public License, see http://www.gnu.org/licenses
*/
error_reporting(E_ALL);
//Check if the form was submitted or not
if (!isset ($_POST['submit'])) {
  header("Location:contact.html");
}
//BOTS TO BLOCK
$bots = "/(Indy|Blaiz|Java|libwww-perl|Python|OutfoxBot|User-Agent|PycURL|AlphaServer|T8Abot|Syntryx|WinHttp|WebBandit|nicebot)/i";
//BADWORDS TO BLOCK
$badwords = "/(bitch|dick|pussy|pussies|ass|****|cum|cumshot|cum shot|
gangbang|gang bang|god dammit|goddammit|viagra|anus|analsex)/i";
//EXPLOITS TO BLOCK
$known_exploits = "/(content-type|bcc:|cc:|javascript|onclick|document.cookie|onload)/i";
//Check if known bot is visiting
if (preg_match($bots, $_SERVER["HTTP_USER_AGENT"])) {
  exit ("Sorry bots are not allowed here!");
}
/*
------------------------------------------------------------------------
--------------------------------------------------------------------------------
*/
//YOUR EMAIL ADDRESS
$YOUR_EMAIL = "feedback@top-titles.co.uk";
//Your email address
$YOURWEBSITE = "My website";
//Your website
$Badword_mask = "****";
//Characters u wanna replace sent badwords with
//CREATE INPUT FILTER FUNCTION
function mss($string) {
  return addslashes(trim(strip_tags(rawurldecode($string))));
}
//END OF INPUT FILTERING FUNCTION
//OUR MAIN PHP VARIABLES
$name = (isset ($_POST['name'])) ? mss($_POST['name']) : FALSE;
$email = (isset ($_POST['email'])) ? mss($_POST['email']) : FALSE;
$message = (isset ($_POST['message'])) ? mss($_POST['message']) : FALSE;
$email_check = "/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$/i";
$ip = (isset ($_SERVER['REMOTE_ADDR'])) ? mss($_SERVER['REMOTE_ADDR']) : FALSE;
//Error array
$errors = array();
//END OF VARIABLE CREATION
/*
INPUT VALIDATION STARTS
*/
if (!$name) {
  $errors[] = "Please enter your name!";
}
if (!$email) {
  $errors[] = "Please enter your email address!";
}
else
  if ($email) {
    if (!preg_match($email_check, $email)) {
      $errors[] = "You must enter a valid email address!";
    }
  }
  if (!$message) {
    $errors[] = "You must enter a message!";
  }
//Check if any errors exist if they do display the errors
  if (count($errors) > 0) {
    foreach ($errors as $error) {
      echo "&bull; $error<br />";
    }
  }
  else {
//Send the email
    $body = "";
    $body .= "You have received an email from $YOURWEBSITE\n\n";
/*
-----------------------------------------------------------------
Loop through post array
-------------------------------------
*/
    foreach ($_POST as $key => $value) {

/*
-----------------------------------------------------------------
Badword checking
-------------------------------------
*/
      if (preg_match($badwords, $value)) {
        $value = preg_replace($badwords, $Badword_mask, $value);
      }
/*
-----------------------------------------------------------------
End of badword checking
-------------------------------------
*/
/*
-----------------------------------------------------------------
Exploit checking & blocking
-------------------------------------
*/
      if (preg_match($known_exploits, $value)) {
        $value = preg_replace($known_exploits, "", $value);
      }
/*
-----------------------------------------------------------------
End Exploit checking & blocking
-------------------------------------
*/
      $body .= ucwords($key) . ":$value\n\n";
    }
/*
-----------------------------------------------------------------
End post array loop
-------------------------------------
*/
    $body .= "IP:$ip\n\n";
    $body .= "Browser:" . $_SERVER['HTTP_USER_AGENT'] . "\n\n";
//SET UP HEADERS
    if (strstr($_SERVER['SERVER_SOFTWARE'], "Win")) {
      $headers = "From:$YOUR_EMAIL\r\n";
      $headers .= "Reply-To:$email\r\n";
    }
    else {
      $headers = "From:$YOURWEBSITE <$YOUR_EMAIL>\r\n";
      $headers .= "Reply-To:$email\r\n";
    }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>TITLE</title>
<meta name="keywords" content="KEYWORDS" />
<meta name="description" content="DESCRIPTION" />
<link rel="stylesheet" href="styles.css" type="text/css" media="all"  />
</head>
<body>
<div id="container">
   <div id="header">
      <div id="navigation">
         <ul id="menu">
	     <li><a href="index.html">HOME</a></li>
	     <li><a href="about.html">ABOUT</a></li>
	     <li class="wide"><a href="portfolio.html">PORTFOLIO</a></li>
	     <li class="wideb"><a href="services.html">SERVICES</a></li>
	     <li class="widec contact"><a href="contact.html">CONTACT</a></li>
	 </ul>
      </div>
   </div>
   <div id="content">    
    
//SEND THE EMAIL
    if (mail($YOUR_EMAIL, $body, $headers)) {
      echo "Your email has successfully been sent!<br /><br />";
    }
    else {
      echo "We can not send the email at this time please try again later!";
      exit ();
    }
}

</div>
<div id="footer">
	<div id="footer_content">
	<p>
	Copyright 2010 Andrew Turner. All rights reserved.
	</p>
	<ul id="footer_menu">
	    <li class="current"><a href="index.html">Home</a></li>
	    <li><a href="about.html">About</a></li>
	    <li><a href="portfolio.html">Portfolio</a></li>
	    <li><a href="services.html">Services</a></li>
	    <li><a href="contact.html">Contact</a></li>
	</ul>
	</div>
</div>
</body>

?>

0

#50 User is offline   webdesigner93 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,858
  • Joined: 22-September 09
  • Reputation: 212
  • Gender:Male
  • Experience:Web Guru
  • Area of Expertise:Web Developer

Posted 07 November 2010 - 03:58 PM

Oh yea i forgot to tell u the html needs to be outside the php tags like this

<?php
/*
Rizo Contact Form Mailer v1.9-- is a free and secure form mailer that you may
use for your website.
(C) Copyright Steve Morgan 2010 all rights reserved.


This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

To read the GNU General Public License, see http://www.gnu.org/licenses
*/
error_reporting(E_ALL);
//Check if the form was submitted or not
if (!isset ($_POST['submit'])) {
  header("Location:contact.html");
}
//BOTS TO BLOCK
$bots = "/(Indy|Blaiz|Java|libwww-perl|Python|OutfoxBot|User-Agent|PycURL|AlphaServer|T8Abot|Syntryx|WinHttp|WebBandit|nicebot)/i";
//BADWORDS TO BLOCK
$badwords = "/(bitch|dick|pussy|pussies|ass|****|cum|cumshot|cum shot|
gangbang|gang bang|god dammit|goddammit|viagra|anus|analsex)/i";
//EXPLOITS TO BLOCK
$known_exploits = "/(content-type|bcc:|cc:|javascript|onclick|document.cookie|onload)/i";
//Check if known bot is visiting
if (preg_match($bots, $_SERVER["HTTP_USER_AGENT"])) {
  exit ("Sorry bots are not allowed here!");
}
/*
------------------------------------------------------------------------
--------------------------------------------------------------------------------
*/
//YOUR EMAIL ADDRESS
$YOUR_EMAIL = "feedback@top-titles.co.uk";
//Your email address
$YOURWEBSITE = "My website";
//Your website
$Badword_mask = "****";
//Characters u wanna replace sent badwords with
//CREATE INPUT FILTER FUNCTION
function mss($string) {
  return addslashes(trim(strip_tags(rawurldecode($string))));
}
//END OF INPUT FILTERING FUNCTION
//OUR MAIN PHP VARIABLES
$name = (isset ($_POST['name'])) ? mss($_POST['name']) : FALSE;
$email = (isset ($_POST['email'])) ? mss($_POST['email']) : FALSE;
$message = (isset ($_POST['message'])) ? mss($_POST['message']) : FALSE;
$email_check = "/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$/i";
$ip = (isset ($_SERVER['REMOTE_ADDR'])) ? mss($_SERVER['REMOTE_ADDR']) : FALSE;
//Error array
$errors = array();
//END OF VARIABLE CREATION
/*
INPUT VALIDATION STARTS
*/
if (!$name) {
  $errors[] = "Please enter your name!";
}
if (!$email) {
  $errors[] = "Please enter your email address!";
}
else
  if ($email) {
    if (!preg_match($email_check, $email)) {
      $errors[] = "You must enter a valid email address!";
    }
  }
  if (!$message) {
    $errors[] = "You must enter a message!";
  }
//Check if any errors exist if they do display the errors
  if (count($errors) > 0) {
    foreach ($errors as $error) {
      echo "&bull; $error<br />";
    }
  }
  else {
//Send the email
    $body = "";
    $body .= "You have received an email from $YOURWEBSITE\n\n";
/*
-----------------------------------------------------------------
Loop through post array
-------------------------------------
*/
    foreach ($_POST as $key => $value) {

/*
-----------------------------------------------------------------
Badword checking
-------------------------------------
*/
      if (preg_match($badwords, $value)) {
        $value = preg_replace($badwords, $Badword_mask, $value);
      }
/*
-----------------------------------------------------------------
End of badword checking
-------------------------------------
*/
/*
-----------------------------------------------------------------
Exploit checking & blocking
-------------------------------------
*/
      if (preg_match($known_exploits, $value)) {
        $value = preg_replace($known_exploits, "", $value);
      }
/*
-----------------------------------------------------------------
End Exploit checking & blocking
-------------------------------------
*/
      $body .= ucwords($key) . ":$value\n\n";
    }
/*
-----------------------------------------------------------------
End post array loop
-------------------------------------
*/
    $body .= "IP:$ip\n\n";
    $body .= "Browser:" . $_SERVER['HTTP_USER_AGENT'] . "\n\n";
//SET UP HEADERS
    if (strstr($_SERVER['SERVER_SOFTWARE'], "Win")) {
      $headers = "From:$YOUR_EMAIL\r\n";
      $headers .= "Reply-To:$email\r\n";
    }
    else {
      $headers = "From:$YOURWEBSITE <$YOUR_EMAIL>\r\n";
      $headers .= "Reply-To:$email\r\n";
    }


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>TITLE</title>
<meta name="keywords" content="KEYWORDS" />
<meta name="description" content="DESCRIPTION" />
<link rel="stylesheet" href="styles.css" type="text/css" media="all"  />
</head>
<body>
<div id="container">
   <div id="header">
      <div id="navigation">
         <ul id="menu">
	     <li><a href="index.html">HOME</a></li>
	     <li><a href="about.html">ABOUT</a></li>
	     <li class="wide"><a href="portfolio.html">PORTFOLIO</a></li>
	     <li class="wideb"><a href="services.html">SERVICES</a></li>
	     <li class="widec contact"><a href="contact.html">CONTACT</a></li>
	 </ul>
      </div>
   </div>
   <div id="content">    
 <?php   
//SEND THE EMAIL
    if (mail($YOUR_EMAIL, $body, $headers)) {
      echo "Your email has successfully been sent!<br /><br />";
    }
    else {
      echo "We can not send the email at this time please try again later!";
      exit ();
    }
}
?>

</div>
<div id="footer">
	<div id="footer_content">
	<p>
	Copyright 2010 Andrew Turner. All rights reserved.
	</p>
	<ul id="footer_menu">
	    <li class="current"><a href="index.html">Home</a></li>
	    <li><a href="about.html">About</a></li>
	    <li><a href="portfolio.html">Portfolio</a></li>
	    <li><a href="services.html">Services</a></li>
	    <li><a href="contact.html">Contact</a></li>
	</ul>
	</div>
</div>
</body>

0

#51 User is online   AndyDesigns 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 240
  • Joined: 13-September 10
  • Reputation: 5
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 07 November 2010 - 04:27 PM

Thankyou it now works great. However, I have just noticed when the email arrives the message is being displayed in the subject field and not in the body of the email. This may be because I removed the $SUBJECT variable just before the input filtering function as my form doesnt have a subject field. Can we edit the the php slightly so it works with no subject field but sends the message data in the email body?
Hope that makes some sense :/

I intend to learn javascript/jquery and PHP myself eventually, but learning another 2 programming languages is gonna take some time so I wanted to use this until then.
0

#52 User is offline   webdesigner93 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,858
  • Joined: 22-September 09
  • Reputation: 212
  • Gender:Male
  • Experience:Web Guru
  • Area of Expertise:Web Developer

Posted 07 November 2010 - 04:41 PM

View Postweb-apprentice, on 07 November 2010 - 04:27 PM, said:

Thankyou it now works great. However, I have just noticed when the email arrives the message is being displayed in the subject field and not in the body of the email. This may be because I removed the $SUBJECT variable just before the input filtering function as my form doesnt have a subject field. Can we edit the the php slightly so it works with no subject field but sends the message data in the email body?
Hope that makes some sense :/

I intend to learn javascript/jquery and PHP myself eventually, but learning another 2 programming languages is gonna take some time so I wanted to use this until then.


the $SUBJECT is not a field its the subject of the email like $SUBJECT = "My site"; ect.. :)
0

#53 User is online   AndyDesigns 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 240
  • Joined: 13-September 10
  • Reputation: 5
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 07 November 2010 - 05:18 PM

View Postwebdesigner93, on 07 November 2010 - 04:41 PM, said:

the $SUBJECT is not a field its the subject of the email like $SUBJECT = "My site"; ect.. :)


oooohhh silly me. I have now put that code back and it all works brilliantly thankyou very much! :good:

I have +1 ur original post :)
0

#54 User is offline   webdesigner93 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,858
  • Joined: 22-September 09
  • Reputation: 212
  • Gender:Male
  • Experience:Web Guru
  • Area of Expertise:Web Developer

Posted 07 November 2010 - 06:52 PM

View Postweb-apprentice, on 07 November 2010 - 05:18 PM, said:

oooohhh silly me. I have now put that code back and it all works brilliantly thankyou very much! :good:

I have +1 ur original post :)


Np if u need more help let me know :)
0

#55 User is offline   Killer 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 201
  • Joined: 07-June 10
  • Reputation: 3
  • Gender:Male
  • Location:North Lincolnshire, UK
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 29 November 2010 - 09:23 PM

Hi there, I'm trying to modify this slightly for a competition entry rather than a contact form. I've got it working in terms of sending the correct info to the correct email address but there are a couple of things I'd like to add.

Firstly the client wants people to have to tick a box to say they've read the T&C of the competition, so I've added a tickbox but I'm not sure how to not submit the form unless they've clicked it. I've seen your php statements to check it but not sure what I'd need to add for this. I tried something but it kept sending without it checked.

Secondly is there anyway to get the error messages to be in a pop up box rather open in a fresh window?

Final thing, is it possible to get a confirmation email to go to the sender as well?

Thanks.
0

#56 User is offline   webdesigner93 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,858
  • Joined: 22-September 09
  • Reputation: 212
  • Gender:Male
  • Experience:Web Guru
  • Area of Expertise:Web Developer

Posted 29 November 2010 - 10:17 PM

View PostAndyDesigns, on 07 November 2010 - 12:42 AM, said:

Thanks for the reply, made that change and now getting this error:

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampplite\htdocs\Andys portfolio\mail_send.php on line 141
We can not send the email at this time please try again later!


Cause ur xammp prob is not set up to send emails :)
0

#57 User is online   rallport 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 3,503
  • Joined: 03-January 10
  • Reputation: 247
  • Gender:Male
  • Location:England, UK
  • Experience:Advanced
  • Area of Expertise:Web Developer

Posted 02 December 2010 - 12:11 PM

View PostKiller, on 29 November 2010 - 09:23 PM, said:



Final thing, is it possible to get a confirmation email to go to the sender as well?



Just change the mailer headers to cc in the sender? Or send a totally seperate message to them using the variables the scripts crerates, using php's mail function.
0

#58 User is offline   webdesigner93 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,858
  • Joined: 22-September 09
  • Reputation: 212
  • Gender:Male
  • Experience:Web Guru
  • Area of Expertise:Web Developer

Posted 13 December 2010 - 02:56 AM

Contact form completely rebuilt to include more spam protection, up to 5 fields and an optional captcha that may be turned off, u can download it from this topic ur in :)
0

#59 User is online   kensha 

  • Expert
  • PipPipPipPip
  • Group: Members
  • Posts: 803
  • Joined: 12-August 10
  • Reputation: 13
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 03 January 2011 - 09:49 AM

Where do I post mine url website to re-direct the page once the form been send?

Thanks in advance, been chekking up the code but don't know where to place it.
0

#60 User is online   rallport 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 3,503
  • Joined: 03-January 10
  • Reputation: 247
  • Gender:Male
  • Location:England, UK
  • Experience:Advanced
  • Area of Expertise:Web Developer

Posted 06 January 2011 - 05:19 PM

View PostKiller, on 29 November 2010 - 09:23 PM, said:


Secondly is there anyway to get the error messages to be in a pop up box rather open in a fresh window?



You need a bit of ajax magic here :)

Keep your setup as it currently is (the form posting to the current page) but had a bit of javascript to catch the click of the submit button. You'd then need to send the requests a form that processes the form and adds validation. If there are errors, return this b ack to user. Could use a simple alert() or one of the many replacements such a JQuery UI.

To make things a little neater, you could have both the form and ajax script posting to the same external file - you can detect ajax requests using a special header - meaning you'd have all your form proicessing in a single php page.
0

#61 User is offline   NeRo 

  • Expert
  • PipPipPipPip
  • Group: Members
  • Posts: 819
  • Joined: 28-September 07
  • Reputation: 38
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 10 January 2011 - 07:50 PM

I'm having a go at using the form - initially I thought it wasn't working, turned out the emails were going into the Spam folder on my webmail and weren't being POP3'd on. Anyway problem sorted by setting a filter.

However, I'm getting the problem as described quoted below. Can you give me some hints what to look for, I would like to try and resolve it myself first

View PostAndyDesigns, on 07 November 2010 - 01:29 AM, said:

Thankyou it is now working great from live domain, except i'm not getting the "your email has been successfully sernt" message even though it HAS sent it.

View Postwebdesigner93, on 07 November 2010 - 01:59 AM, said:

Is the page just blank?

0

#62 User is offline   webdesigner93 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,858
  • Joined: 22-September 09
  • Reputation: 212
  • Gender:Male
  • Experience:Web Guru
  • Area of Expertise:Web Developer

Posted 10 January 2011 - 07:54 PM

View PostNeRo, on 10 January 2011 - 07:50 PM, said:

I'm having a go at using the form - initially I thought it wasn't working, turned out the emails were going into the Spam folder on my webmail and weren't being POP3'd on. Anyway problem sorted by setting a filter.

However, I'm getting the problem as described quoted below. Can you give me some hints what to look for, I would like to try and resolve it myself first

First of all have u recently downloaded it? , cause the script has been completely rebuilt so i'd suggest re downloading it if u have not just downloaded the script. I think the prob listed above happened before i entirely rebuilt the system so give it a try and let me know if u still have problems :)
0

#63 User is offline   webdesigner93 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,858
  • Joined: 22-September 09
  • Reputation: 212
  • Gender:Male
  • Experience:Web Guru
  • Area of Expertise:Web Developer

Posted 30 January 2011 - 11:42 PM

NEW CAPTCHA DESIGN

Heres the new captcha for rizo contact, just replace the old captcha files inside the captcha folder with the new ones from the below zip

Attached File  captcha.png (130.04K)
Number of downloads: 29

Attached File  captcha.zip (43.38K)
Number of downloads: 5
0

#64 User is offline   webdesigner93 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,858
  • Joined: 22-September 09
  • Reputation: 212
  • Gender:Male
  • Experience:Web Guru
  • Area of Expertise:Web Developer

Posted 22 February 2011 - 03:37 AM

Hey i have found a known bug that prevents the message sent from displaying, please remove the
return true
inbetween this if statement

if(@mail()){

}


and just leave inbetween the if statement blank or u can do

if(@mail()){
//Blank
}


using a comment as a holder

This post has been edited by webdesigner93: 22 February 2011 - 03:38 AM

0

#65 User is online   AndyDesigns 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 240
  • Joined: 13-September 10
  • Reputation: 5
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 22 February 2011 - 09:55 PM

View Postwebdesigner93, on 22 February 2011 - 03:37 AM, said:

Hey i have found a known bug that prevents the message sent from displaying, please remove the
return true
inbetween this if statement

if(@mail()){

}


and just leave inbetween the if statement blank or u can do

if(@mail()){
//Blank
}


using a comment as a holder


Hi m8,

I'm still using v1.9 which im sure was working perfectly. However, I just did a quick test and although emails are being sent, im not getting the "your message was sent successfully" message.
I've looked for the return true value in the if statement but there doesnt seem to be one in v1.9.

I would really like to get this working again, i'd rather not have to upgrade to the latest version if possible.

Cheers
0

#66 User is offline   NeRo 

  • Expert
  • PipPipPipPip
  • Group: Members
  • Posts: 819
  • Joined: 28-September 07
  • Reputation: 38
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 22 February 2011 - 10:23 PM

I had some discussion with WD93 when I had the problem of the blank screen and the solution posted does work - I've used it :)

It's just a case of removing the text between the {} as instructed
0

#67 User is online   AndyDesigns 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 240
  • Joined: 13-September 10
  • Reputation: 5
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 22 February 2011 - 10:34 PM

View PostNeRo, on 22 February 2011 - 10:23 PM, said:

I had some discussion with WD93 when I had the problem of the blank screen and the solution posted does work - I've used it :)

It's just a case of removing the text between the {} as instructed


The thing is im using an older version of the form v1.9, which doesnt seem to have that particular 'if' statement at all.

This post has been edited by AndyDesigns: 22 February 2011 - 10:39 PM

0

#68 User is offline   NeRo 

  • Expert
  • PipPipPipPip
  • Group: Members
  • Posts: 819
  • Joined: 28-September 07
  • Reputation: 38
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 22 February 2011 - 10:43 PM

View PostAndyDesigns, on 22 February 2011 - 10:34 PM, said:

The thing is im using an older version of the form v1.9, which doesnt seem to have that particular 'if' statement at all.


If it helps, it is line 193 in the code (contact.php)
0

#69 User is offline   webdesigner93 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,858
  • Joined: 22-September 09
  • Reputation: 212
  • Gender:Male
  • Experience:Web Guru
  • Area of Expertise:Web Developer

Posted 23 February 2011 - 02:24 AM

View PostAndyDesigns, on 22 February 2011 - 09:55 PM, said:

Hi m8,

I'm still using v1.9 which im sure was working perfectly. However, I just did a quick test and although emails are being sent, im not getting the "your message was sent successfully" message.
I've looked for the return true value in the if statement but there doesnt seem to be one in v1.9.

I would really like to get this working again, i'd rather not have to upgrade to the latest version if possible.

Cheers

Hey send me the code in a pm and i'll fix it for u :) yea i dont think v1.9 has that line
0

#70 User is online   AndyDesigns 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 240
  • Joined: 13-September 10
  • Reputation: 5
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 23 February 2011 - 07:48 PM

View Postwebdesigner93, on 23 February 2011 - 02:24 AM, said:

Hey send me the code in a pm and i'll fix it for u :) yea i dont think v1.9 has that line


PM sent, appreciate the help :good:
0

#71 User is offline   NonRealDeveloper 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 21
  • Joined: 16-April 11
  • Reputation: 3
  • Gender:Male
  • Location:Russian Federation
  • Experience:Nothing
  • Area of Expertise:System Administrator

Posted 16 April 2011 - 09:53 PM

www w3schools com/php/filter_validate_email.asp

use it instead of
$email_check = "/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$/i";

1

#72 User is offline   webdesigner93 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,858
  • Joined: 22-September 09
  • Reputation: 212
  • Gender:Male
  • Experience:Web Guru
  • Area of Expertise:Web Developer

Posted 16 April 2011 - 10:24 PM

View PostNonRealDeveloper, on 16 April 2011 - 09:53 PM, said:

www w3schools com/php/filter_validate_email.asp

use it instead of
$email_check = "/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$/i";


Yea they both do the same thing :) already knew about the filter set of functions thanks anyways
0

#73 User is offline   NonRealDeveloper 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 21
  • Joined: 16-April 11
  • Reputation: 3
  • Gender:Male
  • Location:Russian Federation
  • Experience:Nothing
  • Area of Expertise:System Administrator

Posted 17 April 2011 - 10:13 AM

no no, u wrong!
1

#74 User is offline   SniderDK 

  • Expert
  • PipPipPipPip
  • Group: Members
  • Posts: 636
  • Joined: 01-November 08
  • Reputation: 76
  • Gender:Male
  • Experience:Web Guru
  • Area of Expertise:Web Developer

Posted 17 April 2011 - 10:18 AM

View PostNonRealDeveloper, on 17 April 2011 - 10:13 AM, said:

no no, u wrong!


yeah, filter is made in C and validates to the standards, which yours doesn't

checkout lines 303 > 312
http://svn.php.net/v...s.c?view=markup
0

#75 User is offline   NonRealDeveloper 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 21
  • Joined: 16-April 11
  • Reputation: 3
  • Gender:Male
  • Location:Russian Federation
  • Experience:Nothing
  • Area of Expertise:System Administrator

Posted 17 April 2011 - 10:36 AM

I recomended use punycode encoder too, for cyrilic/national domains (.рф and other...)
0

#76 User is offline   dcoder 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 18-January 12
  • Reputation: 0

Posted 18 January 2012 - 11:57 AM

nice script

i will give it a try and check it
0

#77 User is offline   webdesigner93 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,858
  • Joined: 22-September 09
  • Reputation: 212
  • Gender:Male
  • Experience:Web Guru
  • Area of Expertise:Web Developer

Posted 18 January 2012 - 03:42 PM

View Postdcoder, on 18 January 2012 - 11:57 AM, said:

nice script

i will give it a try and check it

Just make sure u replace

if(@mail(YOUR_EMAIL,YOUR_SUBJECT,$body,$headers)){
  return true;
  }


with

if(@mail(YOUR_EMAIL,YOUR_SUBJECT,$body,$headers)){
  //
  }


this is a known bug that causes the success message not to pop up

This post has been edited by webdesigner93: 18 January 2012 - 03:48 PM

0

#78 User is online   Sogo7 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 388
  • Joined: 02-February 11
  • Reputation: 39
  • Gender:Male
  • Location:Camarthen
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 18 January 2012 - 09:03 PM

On the whole not bad at all and very similiar to the one I use.

The captcha is a nice touch because clients do like to see them. Sadly the spambots are a step ahead in the game at this time with automated recognition and of course any human spammer regardless of native language can complete them with very little training.

One way to throw spambots a curve ball is to have the image appear after the submit button has been pressed and require that the captcha be completed in under twenty seconds to confirm that the message should be sent. Whilst this will not stop a human spammer at the keyboard it plays havoc with bots because they cannot typically get an answer back in that timeframe.

Further refinements to play around with...
1. automatically block any IP triggering the $bad, $spam or $exploit lists from making a return visit.
2. Geo-Location check, converting an IP address to country code or Postcode string may be useful for those not running an international business like a plumber in Basingstoke for example. http://html5demos.com/geo
3. IPV6 email validation that can cope with non (currently)standard charecters like jürgen-müller.de or asian glyphs

This post has been edited by Sogo7: 18 January 2012 - 09:10 PM

0

Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users