Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
contact form isnt including name field in email??
Old 09-28-2007, 01:26 PM contact form isnt including name field in email??
Average Talker

Posts: 15
Trades: 0
Hello I have attached a contact form to my site. When I fill in all the info (name/company/email/message) and send the form I check my email to make sure it all went through ok it always fails to include the name. Why is this? This is the script I'm using, is there something wrong? Any help would be greatly appreciated. Thank you!!!




<?php

$your_name = $_GET['Your Name'];
$your_company = $_GET['company'];
$your_email = $_GET['email'];
$your_message = $_GET['message'];

$recipient_email = "lisa76497@aol.com";

$headers .= 'Content-type: text/html; charset=iso-8859-1';

$content = "<html><head><title>Contact letter</title></head><body><br>";
$content .= "Name: <b>" . $your_name . "</b><br>";
$content .= "Company: <b>" . $your_company . "</b><br>";
$content .= "E-mail: <b>" . $your_email . "</b><br><hr><br>";
$content .= $your_message;
$content .= "<br></body></html>";

mail($recipient_email,$subject,$content,$headers);
?>
<html>
<body bgcolor="#FFFFFF">
<div align="center" style="margin-top:60px;color:#0000ff;font-size:11px;font-family:Tahoma;font-weight:bold">
Your message was sent. Thank you.
</div>
</body>
</html>
<script>resizeTo(300, 300)</script>
lisa33 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-28-2007, 01:33 PM Re: contact form isnt including name field in email??
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
Where are you getting your_name from? If you are trying to pass it by url and using $_GET to retrieve it that space in 'Your Name' is going to throw it off.

Also, it doesn't look like you've included the from address in your headers, you may want to add 'From: your@email.com'
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 09-28-2007, 01:44 PM Re: contact form isnt including name field in email??
Average Talker

Posts: 15
Trades: 0
Thank you for replying so quickly!!!!!

So instead of this --> $your_name = $_GET['Your Name'];
it should be --> $your name = $_GET['Your Name'];
or should it be --> $your_name = $GET['yourname'];
lisa33 is offline
Reply With Quote
View Public Profile
 
Old 09-28-2007, 02:02 PM Re: contact form isnt including name field in email??
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
I would advise against using get for emailing, as a spamming could very easily, knock up a script to spammer you. he could have a spam email sent to you continuously and crash you .
Lol he could also do it with post but not as easily
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 09-28-2007, 02:17 PM Re: contact form isnt including name field in email??
maxxximus's Avatar
Extreme Talker

Posts: 219
Name: Rob
Location: UK
Trades: 0
You need to check that the variable name 'Your Name' in the URL is correct as it is this variable that holds the name value that you need.

Also your $subject variable is empty.
maxxximus is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to contact form isnt including name field in email??
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.47248 seconds with 12 queries