Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 05-29-2005, 01:33 PM Email form help
Webmaster Talker

Posts: 560
Trades: 0
Hello, I need some help with my email form. What coding do I need to add to the following in order for it to first check to make sure that the user has completed the "Message" field before hitting Send? Please tell me exactly what code I need to add and where I need to add it. Thanks and I greatly appreciate your help.

Here's the code:

PHP Code:
 <?php

$myemail 
"admin@170designs.com"

if (!isset(
$visitormail)) 
echo 
"Somebody Goofed $ip

$todayis date("l, F j, Y, g:i a") ;

$subject "$subject;

$message "$todayis [EST] \n
Name: 
$visitor ($visitormail)\n
Message: 
$notes \n 

"
;

$from "From: $visitormail\n";

if (
$myemail != ""
mail($myemail$subject$message$from);

?>
Thanks,
Matt
__________________

Please login or register to view this content. Registration is FREE
170 Designs is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-29-2005, 01:48 PM
OmuCuSucu's Avatar
Vi Veri Veniversum Vivus

Posts: 1,168
Name: Dragos-Valentin
Location: Cluj-Napoca, RO
Trades: 0
before hitting send? that can only be done client side ... javascript ...

but if you mean after that, well ...

instead of if ($myemail != "") you can have it:

PHP Code:
if (!is_null($myemail) && !is_null($message)) 
i'm not sure if that is what you are asking for but i hope it helps.
__________________
.
» Please remember to add to my Talkupation if you enjoyed my post. Thank you :)
.
OmuCuSucu is offline
Reply With Quote
View Public Profile
 
Old 05-29-2005, 02:12 PM
Webmaster Talker

Posts: 560
Trades: 0
Yeah, I meant after, heh sorry. But I added that code instead of the one thats there, and it doesnt work. I can still hit "Send" and it goes through, just with no information filled in the spaces... If the message is left blank, I do not want the email to send. So here's what the code looks like now:

PHP Code:
?php

$myemail 
"admin@170designs.com"

if (!isset(
$visitormail)) 
echo 
"Somebody Goofed $ip

$todayis date("l, F j, Y, g:i a") ;

$subject "$subject;

$message "$todayis [EST] \n
Name: 
$visitor ($visitormail)\n
Message: 
$notes \n 

"
;

$from "From: $visitormail\n";

if (!
is_null($myemail) && !is_null($message)) 
mail($myemail$subject$message$from);

?> 
__________________

Please login or register to view this content. Registration is FREE
170 Designs is offline
Reply With Quote
View Public Profile
 
Old 05-31-2005, 09:30 AM
Uche's Avatar
Extreme Talker

Posts: 174
Location: Nigeria/Lagos
Trades: 0
Are you still intresting in getting the Code ???
__________________
Life is just lyke a school where everybody goes to learn one or two thing. the more u school, the more u learn more about school..The more we live our lifes.. the more we learn more about life.

Please login or register to view this content. Registration is FREE
Uche is offline
Reply With Quote
View Public Profile Visit Uche's homepage!
 
Reply     « Reply to Email form help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15847 seconds with 12 queries