Topic awaiting preservation: Lame PHP Form Question |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: Lost Angeles Kalifornia, via Hawaii.... |
posted 02-06-2009 06:35
Ok so I have this PHP guru guy that's been helping me trudge through my PHP on my site and he's not available to help me with what I'm assuming is a simple task... |
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 02-06-2009 10:48
all but the first = should be .=, since you're appending to the string. |
Paranoid (IV) Inmate From: London |
posted 02-06-2009 11:37 |
Paranoid (IV) Inmate From: cell 3736 |
posted 02-06-2009 13:09
this is a string specific thing |
Maniac (V) Mad Scientist From: Denver, CO, USA |
posted 02-06-2009 15:55
yeah, string concatenation is done with a dot between strings. You may also want to through line breaks in after each of the fields "\n" (again, string concatenated) so it won't be one long string. code: $this_message = $_POST['senderName'] . "\n"; $this_message .= $_POST['senderEmail'] . "\n"; $this_message .= $_POST['senderAddy'] . "\n"; $this_message .= $_POST['senderCity'] . "\n"; $this_message .= $_POST['senderZip']; |
Paranoid (IV) Inmate From: Lost Angeles Kalifornia, via Hawaii.... |
posted 02-06-2009 18:57
You guys are sick! I spent all night searching php blogs, php.net, etc. and could not for the life of me figure this out. |
Paranoid (IV) Inmate From: Lost Angeles Kalifornia, via Hawaii.... |
posted 02-06-2009 19:06
Oh, one last thing... so how would I display the results in the email to look a little nicer? |
Maniac (V) Mad Scientist From: Denver, CO, USA |
posted 02-06-2009 20:09
Anytime you want to glue together two strings, you need the dot. code: 1. $this_message = "Name: " . $_POST['senderName'] . "\n";
code: 2. $this_message = "Name: {$_POST['senderName']}\n";
code: 3. $this_message = "Name: $senderName\n";
|
Paranoid (IV) Inmate From: Lost Angeles Kalifornia, via Hawaii.... |
posted 02-06-2009 20:32
You're Awesome... that does the trick. I just needed to know exactly what that was called to search for it. |
Paranoid (IV) Inmate From: cell 3736 |
posted 02-07-2009 11:09
if this form is for regular users then please read about email injection or otherwise spammers will use your site to send e-mails to whoever they want... |