PHP n00b question
- Started
- Last post
- 14 Responses
- BonSeff
my mail handler for my contact page says this:
mail($to, $subject, $body);
and the emails i get dont have a from name, it just says apache.
what am i doing wrong?thanks
- van_rijn0
have a name field in the contact from..
then
mail("$toname ",
"$subject","$body","From: $name ");
- BonSeff0
i tried your suggest and i got an error
this is what i got
$to =
$subject = "BBB Contact Form";
$name = $_POST['name'];
$company = $_POST['company'];
$address = $_POST['address'];
$dropdown = $_POST['drop_down'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$country = $_POST['country'];
$phone = $_POST['phone'];
$besttimetocall = $_POST['besttimetocall'];
$fax = $_POST['fax'];
$email = $_POST['email'];
$comments = $_POST['comments'];$body = "$name
Company:
$companyAddress:
$address
$city, $state $zip
$countryType: $dropdown
Phone: $phone
Best_time_to_call: $besttimetocall
Fax: $fax
Email: $email
Comments: $comments";
header("Location: http://www.chorizoapproved.com/b…
mail($to, $subject, $body, From: $name);
- arlo0
You need to make it a string, so do "From:" . $varname instead of From: $varname.
- van_rijn0
check your mail beotch
- BonSeff0
oh, sweet fellas! it worked.
1 more question if you dont mind..in the from part of the email i get this:
robbie.michael@ss06.shared.serve...is there a way to strip out everything but the name
gracias!!
- enobrev0
hey bon,
put that header('Location... line after your mail line. You shouldn't try changing headers til all your 'stuff' is done.
- BonSeff0
thanks eno
- mike0
enobrev stole my code!
he's a cheat... a cheat I tell you.
- enobrev0
how else am i supposed to trick people into thinking i know what im doing?
- BonSeff0
hey mike, i hope you guys get a carson workshop going here in the states.
- mike0
me too bonseff... I am getting pretty excited about the whole thing (and quite nervous too). I have been writing a lot of code for the cd that will accompany the workshop and I believe there will be a great deal of value in that alone.
if the workshop goes well I think that ryan will look into moving it to other cities... we'll see.
- BonSeff0
if not, fukin film it, sell us a dvd of the pres and the support materials
ther's gold in them there hills damnit!
- mike0
I would never ask anyone to pay to watch me mumble my way through a bunch of tech blather or try to keep up with chris' speed talking... we'll see what ryan has in mind though.
personally, I'd rather do the thing in a pub somewhere and give out shots instead of cd's...
- versa0
now that would be good
i'd WOULD pay for a workshop like that
seriously tho, hope a workshop does get going in other cities
like Denver - ahem ....