Computing.Net > Forums > Programming > PHP Email Function

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

PHP Email Function

Reply to Message Icon

Name: MajorT
Date: July 13, 2004 at 17:34:59 Pacific
OS: WIN XP Pro
CPU/Ram: 3gh/1gb
Comment:

I am an admitted novice at PHP. I'm trying to send data from an HTML file to a PHP file and have the PHP file send an email. Have it all working fairly well, but got stuck trying to include info from a series of checkboxes. They are set up OK in the HTML file (name ending in []). When the email sends now it only picks up the last checkbox checked. I think I need to use a foreach statement, but I can't seem to quite get it correct so the mail function will pick up the entire array. I'm sure this is very basic. Appreciate any suggestions. Thanks in advance



Sponsored Link
Ads by Google

Response Number 1
Name: FBI Agent
Date: July 14, 2004 at 14:21:02 Pacific
Reply:

they have a web development area in this forums. i dont know why people always oost that stuff here. you'd probably get better answeres over there. i actually cant help you with your problem since i've never used a foreach statement successfully.if you post a link to what you have i may be able to suggest a diff way of doing it (i probably could). well, good luck

FBI_Agent


0

Response Number 2
Name: MajorT
Date: July 14, 2004 at 17:54:01 Pacific
Reply:

After roaming thru some other forums, I think I may have stumbled across some code that will work. Never could get the foreach statement to work, but the following seems to accomplish the task:

$mycheckbox = implode(",", $_POST['mycheckbox']);
$msg = "Email:\t$email\n";
$msg .= "Checked:\t$mycheckbox\n";

$message = "Email: $email\nCheckbox: $msg\nRemarks: $mytextarea\n";


0

Response Number 3
Name: FBI Agent
Date: July 16, 2004 at 09:05:48 Pacific
Reply:

$msg .= "Checked:\t$mycheckbox\n";

whats the dot before the equals sign do?

FBI_Agent


0

Response Number 4
Name: Michael J (by mjdamato)
Date: July 19, 2004 at 06:38:17 Pacific
Reply:

The period is a string concatenation function. Used with the equals sign is shorthand to mean the variable equals itself plus whatever follows the equals sign. The line above could also have been written like this:

$msg = $msg . "Checked:\t$mycheckbox\n";


Michael J


0

Response Number 5
Name: FBI Agent
Date: July 22, 2004 at 09:12:25 Pacific
Reply:

cool, thanks

FBI_Agent

AIM: EliteAssassin187


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon

Java problem: UDP client ... swtich statement question



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: PHP Email Function

Perl (or PHP) mail function www.computing.net/answers/programming/perl-or-php-mail-function/14685.html

PHP Mail()-function- all on 1 line? www.computing.net/answers/programming/php-mailfunction-all-on-1-line/5142.html

php mail function www.computing.net/answers/programming/php-mail-function/15167.html