Help on contact form php erro - Singapore Forums by SGClub.com
Singapore Forums by SGClub.com
Sitemap Contact Us FAQ Singapore Forums by SGClub.com
Home Photos Member List Register Mark Forums Read  
Go Back Home > Lifestyle > Workplace and Business Forum » Help on contact form php erro

Why aren't you a member of SGClub.com yet??

» Join 130,000+ other members in chatting.
» Make lots of new friends here.
» Keep up-to-date with current events.
» Participate in Club outings.
» Download lots of Free Stuff!

Registration just takes 2mins and is absolutely free so join our community today!

I Want to Choose my Own Personal Nickname Now!


Reply
 
LinkBack Thread Tools Display Modes
Old 23rd August 2011, 04:15 PM   #1 (permalink)
Cool SGClubber
mabok is on a distinguished road

 
Posts: 174
Join Date: Oct 2008
Likes: 1
Liked 2 Times in 2 Posts
Gender:

Help on contact form php erro

Hi,
i'm using a template theme wordpress.
there's a contact form they provided.

but when i edit the contact form php files to target to my email
there's an error stated there but the message will still able to reach me.

wierd right?

here's the ORIGINAL code:
<?php

// allow us to use core wordpress functions
$oldURL = dirname(__FILE__);
$newURL = str_replace(DIRECTORY_SEPARATOR . 'wp-content' . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . 'complete' . DIRECTORY_SEPARATOR . 'functions', '', $oldURL);
include($newURL . DIRECTORY_SEPARATOR . 'wp-load.php');

function ValidateEmail($email)
{
/*
(Name) Letters, Numbers, Dots, Hyphens and Underscores
(@ sign)
(Domain) (with possible subdomain(s) ).
Contains only letters, numbers, dots and hyphens (up to 255 characters)
(. sign)
(Extension) Letters only (up to 10 (can be increased in the future) characters)
*/

$regex = '/([a-z0-9_.-]+)'. # name

'@'. # at

'([a-z0-9.-]+){2,255}'. # domain & possibly subdomains

'.'. # period

'([a-z]+){2,10}/i'; # domain extension

if($email == '') {
* return false;
}
else {
* $eregi = preg_replace($regex, '', $email);
}

return empty($eregi) ? true : false;
}

$post = (!empty($_POST)) ? true : false;

if($post)
{
$name = stripslashes($_POST['name']);
$subject = 'Contact Form';
$email = trim($_POST['email']);
$to = trim($_POST['to_email']);
$message = stripslashes($_POST['message']);
$error = '';

// Check name

if(!$name)
{
* $error .= 'Please enter your name.<br />';
}

// Check email

if(!$email)
{
* $error .= 'Please enter an e-mail address.<br />';
}

if($email && !ValidateEmail($email))
{
* $error .= 'Please enter a valid e-mail address.<br />';
}

// Check message (length)

if(!$message || strlen($message) < 15)
{
* $error .= "Please enter your message. It should have at least 15 characters.<br />";
}

if(!$error) // send email
{
* $mail = wp_mail($to, $subject, $message,
* * 'From: '.$name.' <'.$email.'>\r\n'
** .'Reply-To: '.$email.'\r\n'
** .'X-Mailer: PHP/' . phpversion());

* if($mail)
* {
** echo 'OK';
* }

}
else
{
* echo '<div class="notification_error">'.$error.'</div>'; // set up error div for jQuery/Ajax
}

}

?>

i only change this part:
$regex = 'myname'. # name

'@'. # at

'mysite'. # domain & possibly subdomains

'.'. # period

'net'; # domain extension
the message will be sent, but there's error poppin out:
Warning: preg_replace() [function.preg-replace]: Delimiter must not be alphanumeric or backslash in /home/a2079912/public_html/wordpress/wp-content/themes/complete/functions/contact.php on line 33


will be really glad someone help me.
thanks for reading this thread, appreciate lots! ;D

Sponsors:
mabok is offline  
Add to mabok's Reputation Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help: Any Free HTML Contact Form -Mathematics Workplace and Business Forum 8 8th December 2010 05:40 PM
WTS: POA (2%) top form Hk( NEW) applezi12 Clothes & Accessories 65 2nd July 2009 05:36 PM
Survey to Non Contact lens and Contact Lens wearer. Urgent! TeddyYeo Project Surveys & Help 5 24th May 2009 03:38 PM
Haseo Xth Form VS Sora Final Form Arakai Gamers Zone 7 3rd December 2008 05:13 PM
♥♥♥ Preorder GEO Contact Lenses (Giving Away Free Contact Lens Casing) ! ♥♥♥ HUIWEN♥ General Merchandise 22 29th October 2008 04:05 PM

» Sponsors
Watch Free Movies Online
Celebrity Gossip
Food Delivery

» Facebook Fans
» What's Going On?
Title, Username, & Date
Ritter Sport chocolate recalled due to undeclared allergen
Aoki Hagane no Arpeggio: Ars Nova
I really hate my mother!!!
Mum's Kitchen Catering and Cherish Delights get licences suspended after nearly 40 people...
Transcend RDF9K2 All-in-One Card Reader
Transcend ESD250C, a portable SSD that’s super classy
Stupid court of appeal gives red light running driver who hit pedestrian 15% discount
How PAP exploited racial differences to impose FASCIST rule over Singapore.
Up to S$7250 of government $ misused for buying each vote in Singapore?
Funky Fields organic vegan spreadable recalled due to 'undisclosed allergen'
100 hawksbill turtles released into the sea after rare hatching on Sentosa
Inspirational Songs
Repost comment.
MOH, SFA investigating after 18 typhoid fever cases in 3 weeks
By militarily invading Hong Kong, Xi Jingping is setting in motion, the wheels of nuc
Deng XiaoPing original vision for HKG- China reunification was for the two to unite a
HSA warns against three products
Warning : Blacklist buyer/adopter Alert
512GB Transcend 830S M.2 SSD Review
Poisonous PAPers.
Featured Photos
by marisoljames322
· · ·
Member Galleries
20359 photos
13619 comments
by marisoljames322
· · ·
Member Galleries
20359 photos
13619 comments
by pdsubbu
· · ·
Member Galleries
20359 photos
13619 comments
by Vikas Dhar
· · ·
Photography
35 photos
36 comments
by aaudreygan
· · ·
Guy Photos
1581 photos
946 comments
by aaudreygan
· · ·
Girl Photos
4351 photos
28606 comments
by a8paris
· · ·
Guy Photos
1581 photos
946 comments
by a8paris
· · ·
Guy Photos
1581 photos
946 comments
by aaricia
· · ·
Girl Photos
4351 photos
28606 comments
by aaricia
· · ·
Girl Photos
4351 photos
28606 comments

 

All times are GMT +8. The time now is 06:00 AM.


Powered by vBulletin
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright© 2004-2013 SGClub.com. All rights reserved.