Page 1 of 1

Need help fixing a mailto form...

Posted: Fri Sep 16, 2005 1:25 pm
by WithHisStripes
Heya,
I am working on a form that is emailed to me, but I have a problem with the code; for the telephone line, for example, there are four text fields, 'country code', 'area code', '3_digit' and '4_digit;. I want them, once emailed to me, to appear on the same line. An example is below:

First Name: Spencer
Last Name: Hill
Email: Whomever@Whatever.com
Telephone: 1(503)-885-9999
City: Sherwood
State or Province: OR
Name of State or Province If It Wasn't Listed: Oregon
Country: Australia
Skills and Abilities: Blah blah blah
Comments: Comments

But what happens, is the telephone and any other lines that I want to be listed on the same line (ie the telephone number) won't even appear.

Here is my code:

//General Information
$msg="First Name: " . $_POST['first_name'] . "\n";
$msg.="Last Name: " . $_POST['last_name']. "\n";
$msg.="Email: " . $_POST['email']. "\n";
$msg.="Telephone: " . $_POST['country_code, area_code, 3_digits, 4_digits']. "\n"; <---This is where I think I'm going wrong with my code.
$msg.="Payment Type" . $_POST['Payment Type']. "\n";
$msg.="Card Number and Security Code: " . $_POST['card_number, security_code']. "\n";
$msg.="Expiration Date Month and Year: " . $_POST['month, year']. "\n";

Any ideas?

-Spence

Posted: Fri Sep 16, 2005 1:34 pm
by ryanlwh

Code: Select all

$msg.="Telephone: " .$_POST['country_code']."(".$_POST['area_code'].")-".$_POST['3_digits']."-".$_POST['4_digits']. "\n";
Each of the elements in $_POST are separated indexes. You cannont combine them into a gigantic index.

Posted: Fri Sep 16, 2005 3:14 pm
by feyd
WithHisStripes, please use

Code: Select all

or

Code: Select all

tags where appropriate when posting code. Read the first link in my signature if you need further details..

another advice...

Posted: Fri Sep 16, 2005 3:48 pm
by imc1975
ryanlwh wrote:

Code: Select all

$msg.="Telephone: " .$_POST['country_code']."(".$_POST['area_code'].")-".$_POST['3_digits']."-".$_POST['4_digits']. "\n";
Each of the elements in $_POST are separated indexes. You cannont combine them into a gigantic index.
try to use the isset() function, in case that values in the form were left empty:

$msg.="Telephone: " .isset($_POST['country_code'])?$_POST['country_code']:''."(".$_POST['area_code'].")-".$_POST['3_digits']."-".$_POST['4_digits']. "\n";

I wrote only the first, left up to you the others...


feyd | if you intend to post using bbcode, make sure it's on

Posted: Sat Sep 17, 2005 1:33 pm
by WithHisStripes
Hey guys, maybe I'm just overlooking something but I tried both ways and got nothing. Any more ideas? If you go to http://www.hookweb.net/testing/email_form.zip than you can download both files and tell me what I'm missin.
-Spence