Jump to content


Processing a Simple Form - Beginner

php forms

This topic has been archived. This means that you cannot reply to this topic.
No replies to this topic

#1 dlmagers

  • Members
  • Pip
  • Newbie
  • 6 posts

Posted 11 February 2013 - 05:16 PM

Hello, I am trying to teach myself how to process a simple form in php. Here is what I want to do. I have a simple form.html document and I want to have input fields for First Name and Last Name and Gender.

The Gender field I want to be able to send them the right message if they enter 'M' for Male or 'F' for Female I want to be able to say something like 'Welcome 'Mr or Mrs' First Name and Last Name' in an echo statement.

Here is the code I have thus far.
I have this in the body of my welcome.php page

echo(" Welcom Mr.=\"Fname"\"Lname"\");
echo(" Welcome Mrs.=\"Fname"\"Lname"\");

This is my index.html

this is the code I have with the body

<form action="welcome.php" method="post">
		 <h2><span class="required_notification">* Denotes Required Field</span>			 </h2>			
			 <p>First Name:
<input type="text" name="Fname" maxlength="50" placeholder="First Name" required />
			 <p> Last Name
<input type="text" name="Lname" maxlength="75" placeholder="Last Name" required />
			 Sex (Enter 'M' for Male or 'F' for Female):
			 <input type="text" name="Gender" maxlength="1" placeholder="'M' or 'F'" required />
			 <input type="submit" name="formSubmit" value="Submit" />


Nevertheless, it is not working. Please keep in mind I just started on this and I am not sure if Iknow what I doing. Well, then it is apparent I don't know what I am doing. Could someone please help me and point me in the right direction? Thank you in advance.