473,474 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

PHP Form sending blank

2 New Member
Hi,

I made a php form and when it sends the data is blank.

it just shows

Name:
Email:
Number:
Comments:

Help!!!!!!!!!

Thanks!!


<?php

/* Subject and Email Variables */

$emailSubject = 'TheChallahFairy!';
$webMaster = 'nicole.frenkel@gmail.com';

/* Gathering Data Variables */

$nameField = $_POST['name'];
$numberField = $_POST['number'];
$emailField = $_POST['email'];
$commentsField = $_POST['comments'];

$body = <<<EOD
<br><hr><br>
Name: $name <br>
Number: $number <br>
Email: $email <br>
Comments: $comments <br>
EOD;

$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);






<form action="contactsending.php" method="post" name="form" id="form">
<p>&nbsp;</p>
<p>Name<br />
<input name="name" type="text" size="30" id="name" />
<br />
<br />
Telephone Number<br />
<input name="number" type="text" size="30" id="number" />
<br />
<br />
Email Address<br />
<input name="email" type="text" size="20" id="email" />
<br />
<br />
Comments<br />
<textarea name="comments" cols="40" rows="8" id="comments">
</textarea>
<br />
<br />
<input type="submit" value="Send" />
</p>
</form>
Dec 7 '11 #1
4 1686
Rabbit
12,516 Recognized Expert Moderator MVP
That's because your variable is called $nameField, not $name, etc.
Dec 7 '11 #2
Ammu
78 New Member
You can use
echo "Name:";
echo $name;
echo "<br>";

OR

echo "Name:".$_POST['name'];
Dec 7 '11 #3
Nicole Frenkel
2 New Member
Thank you it worked!
Dec 7 '11 #4
Rabbit
12,516 Recognized Expert Moderator MVP
Please mark the post that worked as the answer.
Dec 7 '11 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jerry Sievers | last post by:
Fellow coders; I am curious about a difference in behavior between Mozilla and MSIE. The scenario; 1. a php form page is loaded on first hit with field values set to various things including...
1
by: Keith | last post by:
I am Using Dreamweaver MX to create my site and have come accross a problem no one in the DW groups seems to be able to help with. When I submit an insert to my SQL database, any form value which...
2
by: JohnGates | last post by:
In VB.net, I have win form programs that do database update operations that take several minutes or longer. Several actions such as switching windows or clicking a control during these operations...
2
by: youngster94 | last post by:
I was dragging a third party component from the toolbar to drop on form1, when for some reason Visual Studio gave me an unrecoverable error and told me to save my work and restart VS. After...
3
by: TS | last post by:
we publish our exceptions to email at work and include the form's vlaues to help debug in production. Since the control wont' appear if it is empty, how can i access it to show the controls wiht a...
4
by: fanis | last post by:
Please help me on this one. I use the docmd.openform "frmName",,,stLinkCriteria expresion to open a form. For example: stlinkcriteria = " = " & 44 Although RecID = 44 exists the form opens with...
4
by: JohnnyMid | last post by:
I am working on a database, and have been having some trouble with the auto number feature. Occasionally, the data entry form is saving blank records into the table. I am trying to figure out a way...
2
by: Del | last post by:
I have a popup form that consist of a single field called EnteredBy and a Subform that has three fields. The popup form also has a button in the Form Footer called close. In the On Click event I...
0
by: sheel331 | last post by:
Hello, I am new to coding in vb.net and have run into an issue with some code that I am looking over. This is a webform that is filled out and once it is filled out, it takes the responses from...
3
by: kronecker | last post by:
I converted a C# program to VB.Net and it compiles fine. However, when I run it I get a blank form with nothing on it. There should be a few text boxes,pull down menus etc that I put on the form...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.