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
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
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:
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
Summary: Michael J is right - you don't need to point it to your mail server, since the $to variable contains the destination of the email. Also, the PHP mail() function must be included during compile time wh...
Summary: Hi, I'm having a little problem. I have a form (in flash) which calls this code in a php-page: $subject = "My subject"; $contactname = "my name"; $contactemail = "my@email.adres"; $message = "my messa...
Summary: Hey guys, I'm not a big php programmer, but I'm sure someone can help me. My code is as follows. I don't get any error messages, but the emails don't deliver. I'm basically pulling the addresses fr...