PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi everyone,
This should be so simple but I just can't crack it.
I have an online form and I want to make sure there are no blank fields being submitted. I'm not sure on how to do this. The simpler the solution the better.
Here is a snippet of my online application.php code
[syntax="html"]<body>
<form action="email application.php" method="post" name="online application" class="style1" id="online application">
<fieldset>
<label for="name">Name of Child: </label>
<input name="name" type="text" id="name" title="name" value="">
<br>
<label for="dob">Birth / Expected Arrival Date: </label>
<input type="text" id="dob" name="dob" title="dob" >
Would i put the verification form into this online application.php or into my email application.php also im not sure.
Any assistance would be greatly appreciated or even a link to a good reference.
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Ive been playing around with the email application.php file but still no luck
Here are the last lines of code that im stuck on. I constantly receive the 'Please input data' message even when the name field is populated with text.
You need to specify that the variable resides in the _POST array, from your form. the isset() function would work fine here as well; check my example. You receive the message because '$name' doesn't exist outside of the post array.
If you want to simplify things for yourself, set your post variables to regular variables.. like so: