Yes, thanks the book is on order hasn't arrived yet.
I have shown below what is used for this class:
This is what is used on the form page in the demo of this
class.
Will dreamweaver allow me to include this class with the
insert record etc.
I have noted in Google searches that people have had trouble
with includes using dreamweaver. I am using dreamweaver 2004 not
dreamweaver 8.
I tried to use the examples for form validation using php
from David Powers and it worked brilliantly the first time and when
I turned the computer on the next day it wouldn't. It now will not
validate anything on that page no matter what I change. Even if I
use the Check Username exists or anything I used previously.
I must have a bug or something.
So I am a little terrified of changing my files as I spent
many weeks on this. So I thought my alternative was to use this
class and include it within.
include("validation_class.php");
if (isset($_POST['submit'])) {
$example = new Validate_fields;
$example->check_4html = true;
$example->add_text_field("Simple_text", $_POST['string'],
"text", "y");
$example->add_num_field("Number", $_POST['number'],
"number", "n", 0, 5);
$example->add_num_field("Number_with_decimals",
$_POST['decimal'], "decimal", "n", 2);
$example->add_date_field("Euro_date", $_POST['date'],
"date", "eu", "n");
$example->add_check_box("Check_box", "check",
"checkbox");
$example->add_link_field("Email_address",
$_POST['email'], "email");
$example->add_link_field("internet_link", $_POST['url'],
"url", "n");
if ($example->validation()) {
$error = "All form fields are valid!"; // replace this text
if you like...
} else {
$error = $example->create_msg();
}
}
?>
Thanks