logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > PHP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 09-06-2011, 04:27 PM   #1
designer_282
 
Join Date: Feb 2011
Posts: 31
Default Php email form help

I'm having issues the php email form on the tutorials page. Well, everything works fine except that it doesn't send an email.

Here's the code:

PHP Code:
//--------------------------Set*these*paramaters-------------------------- 

//*Subject*of*email*sent*to*you. 
$subject*=*'Results*from*Contact*form';* 

//*Your*email*address.*This*is*where*the*form*information*will*be*sent.* 
$emailadd*=*'';* 

//*Where*to*redirect*after*form*is*processed.* 
$url*=*'';* 

//*Makes*all*fields*required.*If*set*to*'1'*no*field*can*not*be*empty.*If*set*to*'0'*any*or*all*fields*can*be*empty. 
$req*=*'1';* 

//*--------------------------Do*not*edit*below*this*line-------------------------- 
$text*=*"Results*from*form:\n\n";* 
$space*=*'*'
$line*=*
'

foreach*(
$_POST*as*$key*=>*$value

if*(
$req*==*'1'

if*(
$value*==*''
{echo*
"$key*is*empty";die;} 

$j*=*strlen($key); 
if*(
$j*>=*20
{echo*
"Name*of*form*element*$key*cannot*be*longer*than*20*characters";die;} 
$j*=*20*-*$j
for*(
$i*=*1;*$i*<=*$j;*$i++) 
{
$space*.=*'*';} 
$value*=*str_replace('\n',*"$line",*$value); 
$conc*=*"{$key}:$space{$value}$line"
$text*.=*$conc
$space*=*'*'

mail($emailadd,*$subject,*$text,*'From:*'.$emailadd.''); 
echo*
'.$url.'">'; 
?> 
I've removed my email and url parameters since it's no ones business what those are..

I just don't understand why it won't send the email...Is the code defective??

p.s. I don't know and barely understand php, so any help is appreciated!
designer_282 is offline   Reply With Quote
Old 09-07-2011, 02:20 AM   #2
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,175
Default

dont understand all the *'s, they would make it fail
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 09-07-2011, 12:52 PM   #3
designer_282
 
Join Date: Feb 2011
Posts: 31
Default

Thank you! It seems like it was my email that was the problem. I know typed it in correctly, but nevertheless I changed it and now its working fine.
designer_282 is offline   Reply With Quote
Reply


Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 12:30 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com