I have a form that I want to validate. I only need 1 checkbox checked. I am a little unsure of how to make this work, as I am not a php guru, this is the first time I have used php on a project. It is as such:
<?php
if ($fname == "" or $lname == "" or $email == "" or $address =="") {
echo '<META HTTP-EQUIV="Refresh" CONTENT="0;URL=http://www.newworldfunds.com/personalform.php">';
}
$message = "Name: " . $fname . " " . $lname . "\n";
$message = $message . "Email: " . $email . "\n";
$message = $message . "Address: " . $address . "\n";
$message = $message . "Home Phone: " . $hphone . "\n";
$message = $message . "Work Phone: " . $wphone . "\n";
$message = $message . "Fax: " . $fax . "\n";
$message = $message . "Can contact: " . $contact . "\n";
?>
<head>
<title>Investor Questionnaire</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
a:hover{color:#0000FF;}
a:link{text-decoration:none}
a:visited{text-decoration:none}
a:active{text-decoration:none}
a{cursor:arrow}
body {scrollbar-face-color: #666666; scrollbar-shadow-color: #000000;
scrollbar-highlight-color: #000000; scrollbar-3dlight-color: #FFFFFF;
scrollbar-darkshadow-color: #FFFFFF; scrollbar-track-color: #FFFFFF;
scrollbar-arrow-color: #FFFFFF;}
</style>
</head>
<body bgcolor="#FFFFFF">
<table width="500" border="10" cellspacing="1" cellpadding="5" height="60" align="center" bordercolor="666666">
<tr>
<td>
<div align="center"><img src="pictures/logobigger.jpg" width="281" height="86"></div>
</td>
</tr>
</table>
<table width="500" border="0" cellspacing="1" cellpadding="5" align="center" height="30">
<tr>
<td>
<div align="center"><img src="pictures/investquestionT.jpg" width="355" height="44"></div>
</td>
</tr>
</table>
<div align="center"></div>
<table width="500" border="10" cellspacing="1" cellpadding="5" align="center" bordercolor="666666">
<tr valign="top">
<td height="397">
<p><font face="Arial" size="2"><b><font face="Times New Roman" size="3">Accredited
Investor Status</font></b></font><font face="Times New Roman" size="3"><br>
<font color="#CC3333">Unless otherwise determined by the General Partner,
the Partnership will accept subscription offers only from persons who
are "Accredited Investors," as that term is defined in Regulation D under
the Securities Act. <i>PLEASE CHECK THE APPROPRIATE SPACE(S) IN THIS SECTION
INDICATING THE BASIS ON WHICH YOU QUALIFY AS AN INVESTOR.</i></font></font></p>
<p><font color="#000000" face="Times New Roman" size="3"><b>Qualification
as an Accredited Investor<br>
</b></font><font color="#FF0000" face="Times New Roman" size="3"> <font color="#CC3333">Please
check the categories applicable to you indicating the basis upon which
you qualify as an Accredited Investor for purposes of the Securities Act
and Regulation D thereunder.<br>
</font> </font></p>
<form name="form1" action=".php" method="post">
<input type="hidden" name="message" value="<?php echo $message; ?>">
<p> <font face="Times New Roman" size="3">
<input type="checkbox" name="checkbox" value="checked">
<b>INDIVIDUAL WITH NET WORTH IN EXCESS OF $1.0 MILLION</b>. A natural
person (not an entity) whose net worth, or joint net worth with his
or her spouse, at the time of purchase exceeds $1,000,000. (Explanation:
In calculating net worth, you may include your equity in personal property
and real estate, including your principal residence, cash, short-term
investments, stock and securities. Your inclusion of equity in personal
property and real estate should be based on the fair market value of
such property less debt secured by such property.) </font></p>
<p> <font face="Times New Roman" size="3">
<input type="checkbox" name="checkbox2" value="checked">
<b> INDIVIDUAL WITH A $200,000 INDIVIDUAL ANNUAL INCOME</b>. A natural
person (not an entity) who had an individual income of more than $200,000
in each of the preceding two calendar years, and has a reasonable expectation
of reaching the same income level in the current year.</font></p>
<p> <font face="Times New Roman" size="3">
<input type="checkbox" name="checkbox3" value="checked">
<b>INDIVIDUAL WITH A $300,000 JOINT ANNUAL INCOME</b>. A natural person
(not an entity) who had joint income with his or her spouse in excess
of $300,000 in each of the preceding two calendar years, and has a reasonable
expectation of reaching the same income level in the current year.</font></p>
<p> <font face="Times New Roman" size="3">
<input type="checkbox" name="checkbox4" value="checked">
<b>CORPORATIONS OR PARTNERSHIPS</b>. A corporation, partnership, or
similar entity that has at least $5 million of assets and was not formed
for the specific purpose of acquiring an Interest in the Partnership.</font></p>
<p> <font face="Times New Roman" size="3">
<input type="checkbox" name="checkbox5" value="checked">
<b>REVOCABLE TRUST</b>. A trust that is revocable by its grantors and
each of whose grantors is an accredited investor. (If this category
is checked, please also check the additional category or categories
under which the grantor qualifies as an accredited investor.)</font></p>
<p> <font face="Times New Roman" size="3">
<input type="checkbox" name="checkbox6" value="checked">
<b>IRREVOCABLE TRUST</b>. A trust (other than an ERISA plan) that (i)
is not revocable by its grantors, (ii) has at least $5 million of assets,
(iii) was not formed for the specific purpose of acquiring an Interest,
and (iv) is directed by a person who has such knowledge and experience
in financial and business matters that such person is capable of evaluating
the merits and risks of an investment in the Partnership.</font></p>
<p> <font face="Times New Roman" size="3">
<input type="checkbox" name="checkbox7" value="checked">
<b> IRA OR SIMILAR BENEFIT PLAN</b>. An IRA, Keogh or similar benefit
plan that covers a natural person who is an accredited investor. (If
this category is checked, please also check the additional category
or categories under which the natural person covered by the IRA or plan
qualifies as an accredited investor.)</font></p>
<p> <font face="Times New Roman" size="3">
<input type="checkbox" name="checkbox8" value="checked">
<b>PARTICIPANT-DIRECTED EMPLOYEE BENEFIT PLAN ACCOUNT</b>. A participant-directed
employee benefit plan investing at the direction of, and for the account
of, a participant who is an accredited investor. (If this category is
checked, please also check the additional category or categories under
which the participant qualifies as an accredited investor.)</font></p>
<p> <font face="Times New Roman" size="3">
<input type="checkbox" name="checkbox9" value="checked">
<b>OTHER ERISA PLAN</b>. An employee benefit plan within the meaning
of Title I of the ERISA Act other than a participant-directed plan with
total assets of at least $5 million or for which investment decisions
(including the decision to purchase an Interest) are made by a bank,
registered investment adviser, savings and loan association, or insurance
company.</font></p>
<p> <font face="Times New Roman" size="3">
<input type="checkbox" name="checkbox10" value="checked">
<b>GOVERNMENT BENEFIT PLAN</b>. A plan established and maintained by
a state, municipality, or any agency of a state or municipality, for
the benefit of its employees, with total assets of at least $5 million.</font></p>
<p> <font face="Times New Roman" size="3">
<input type="checkbox" name="checkbox11" value="checked">
<b>NONPROFIT ENTITY</b>. An organization described in Section 501(c)(3)
of the Internal Revenue Code, as amended, with total assets in excess
of $5 million (including endowment, annuity and life income funds),
as shown by the organization's most recent audited financial statements.</font></p>
<p><font face="Times New Roman" size="3"><b>OTHER INSTITUTIONAL INVESTOR</b>
(<font color="#FF0000">check one</font>). <br>
<input type="checkbox" name="checkbox12" value="checked">
A bank, as defined in Section 3(a)(2) of the Securities Act (whether
acting for its own account or in a fiduciary capacity); <br>
<input type="checkbox" name="checkbox13" value="checked">
A savings and loan association or similar institution, as defined in
Section 3(a)(5)(A) of the Securities Act (whether acting for its own
account or in a fiduciary capacity;<br>
<input type="checkbox" name="checkbox14" value="checked">
A broker-dealer registered under the Exchange Act; <br>
<input type="checkbox" name="checkbox15" value="checked">
An insurance company, as defined in section 2(13) of the Securities
Act; <br>
<input type="checkbox" name="checkbox16" value="checked">
A "business development company," as defined in Section 2(a)(48) of
the ICA; <br>
<input type="checkbox" name="checkbox17" value="checked">
A small business investment company licensed under Section 301(c) or
(d) of the Small Business Investment Act of 1958, as amended; or <br>
<input type="checkbox" name="checkbox18" value="checked">
A "private business development company" as defined in Section 202(a)(22)
of the Investment Advisers Act of 1940, as amended.</font></p>
<p><font face="Times New Roman" size="3"><b>
<input type="checkbox" name="checkbox19" value="checked">
ENTITY OWNED ENTIRELY BY ACCREDITED INVESTORS</b>. A corporation, partnership,
private investment company or similar entity each of whose equity owners
is a natural person who is an accredited investor. (If this category
is checked, please also check the additional category or categories
under which each natural person qualifies as an accredited investor.)<br>
<br>
<input type="submit" name="Submit" value="Submit">
<br>
<br>
<br>
</font></p>
</form>
<p> </p>
</td>
</tr>
</table>
</body>
this is what I am thinking, but do not know where to place it:
<?php
if (empty($checkbox)&&empty($checkbox2)&&empty($checkbox3)&&empty($checkbox4)
&&empty($checkbox5)&&empty($checkbox6)&&empty($checkbox7)&&empty($checkbox8)
&&empty($checkbox9)&&empty($checkbox10)&&empty($checkbox11)&&empty($checkbox12)
&&empty($checkbox13)&&empty($checkbox14)&&empty($checkbox15)&&empty($checkbox16)
&&empty($checkbox17)&&empty($checkbox18)&&empty($checkbox19)) {
return FALSE; echo 'please fill out this value';
}
?>
should i create a new php file to validate, and have it submit if all is true(and if so what do i need to add to get this to submit) or can i add it to this page?