Page 2 of 2

Posted: Mon Aug 20, 2007 9:41 pm
by rleslie1970
actually the code that i posted was the section before validating your form. she does have a section on that; however, she makes it kind of confusing.

Up until now, she has you build two files - one an html file and the other a php file that does the scripting. In the section on form validation however, she has you build one file - a php file and create your entire form as a variable and add a bunch of if and else statements that send up red comments if data isn't entered. Is that normal to build only one file? or can you do form validation when you have two files? Maybe not...since the original file is html and you need to do the form validation in php......

Posted: Mon Aug 20, 2007 10:07 pm
by superdezign
Typically, we suggest that it all be done in one file, but technically, when you separate form from function, it can span across multiple files. I'm not exactly sure what the example you are referring to works like, as the mixture of a static HTML file and a processing PHP file isn't something I've tried in that sense.

Posted: Mon Aug 20, 2007 11:04 pm
by RobertGonzalez
There are lots of ways to accomplish what the author is suggesting. I just wish the author would have thought to suggest validation before anything you implement. But its all good, as long as what you are learning in the book never makes it off of your local server, you should be safe.