Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 27-03-2007, 09:55 AM
New kid on the block
 
Join Date: Jun 2006
Location: putrajaya
Posts: 5
Rep Power: 0
nanazack is on a distinguished road
Send a message via Yahoo to nanazack
send contact us form to email

hi there! i need help from all of u about my problem...

my problem is, i need to send data from contact us form to email... but till now my coding tak menjadiiiiii!!! why? can u all tell me why?? plzzz...

the problem is, all the data success send but not to email. is that about the server? is that my server block the mail() function?

this is my coding :

<?php

$errmsg = ''; // error message
$sname = ''; // sender's name
$email = ''; // sender's email addres
$subject = ''; // message subject
$message = ''; // the message itself

if(isset($_POST['send']))
{
$sname = $_POST['sname'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];

if(trim($sname) == '')
{
$errmsg = 'Please enter your name';
}
else if(trim($email) == '')
{
$errmsg = 'Please enter your email address';
}
else if(!isEmail($email))
{
$errmsg = 'Your email address is not valid';
}
else if(trim($subject) == '')
{
$errmsg = 'Please enter message subject';
}
else if(trim($message) == '')
{
$errmsg = 'Please enter your message';
}

if($errmsg == '')
{
if(get_magic_quotes_gpc())
{
$subject = stripslashes($subject);
$message = stripslashes($message);
}

// the email will be sent here
$to = "nanazack@yahoo.com";

// the email subject
$subject = '[Contact] : ' . $subject;

// the mail message ( add any additional information if you want )
$msg = "From : $sname \r\n " . $message;

mail($to, $subject, $msg, "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n");

?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 27-03-2007, 10:24 AM
yipguseng's Avatar
Lost Webmaster
 
Join Date: Jan 2007
Location: Petaling Jaya
Posts: 857
Rep Power: 41
yipguseng will become famous soon enough yipguseng will become famous soon enough
Send a message via MSN to yipguseng
since u said ur data is successfully sent. from my guess is ur mail(), y not try to store the whole 4th parameter to a variable instead of putting the whole expression there? mayb tat cause the problem? i m not sure also coz i seldom deal with mail(), but js try and out and also simplify the code a but
__________________
Boonage - Freedom is Everything
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-04-2007, 11:14 PM
calvynlee's Avatar
Blogging Moderator
 
Join Date: Jul 2006
Location: LittlePenang.com
Posts: 1,690
Rep Power: 63
calvynlee has a spectacular aura about calvynlee has a spectacular aura about
u are using free hosting or paid hosting.
mostly free hosting disable the mail ()...
__________________
I blog my IT Engineer LIFE at iCalvyn.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to send email through asp? pepsi_blue Website Programming 5 28-06-2007 11:55 PM
Snap, Send & Win !!! lina News and Announcements 0 06-07-2006 12:06 PM
send parameter sangasura Website Programming 5 06-09-2005 04:31 PM
send var ciki Website Programming 21 19-02-2004 03:28 PM
send form script alvinhan Website Programming 8 05-05-2002 01:16 AM



All times are GMT +8. The time now is 03:26 PM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60