Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hey guys, I am going to post a partial code with my checkboxed part of my php form, I am new to php so bear with me. I cannot get this to send to me right, I get the email and everyhitng else id fine except next to the part that is suppose to tell the checked boxes it says Aray,Aray,Aray
<TABLE cellSpacing=3 cellPadding=0 width="80%" border=0>
<TR class="weak">
<TD><INPUT
name=Domain[] type=checkbox id=Domain value=yes></TD>
<TD>Domain Name Registration </TD>
<TD><INPUT id=webhosting type=checkbox value=yes
name=webhosting[]></TD>
<TD>Web Site Hosting</TD>
</TR>
<TR class="weak">
<TD><INPUT id=marketing type=checkbox
value=yes name=marketing[]></TD>
<TD>Internet Marketing</TD>
<TD><INPUT id=webdesign type=checkbox value=yes
name=webdesign[]></TD>
<TD>Web Site Design</TD>
</TR>
<TR class="weak">
<TD><INPUT id=cemail type=checkbox value=yes
name=cemail[]></TD>
<TD>Email Accounts</TD>
<TD><INPUT id=Maintenance type=checkbox value=yes
name=Maintenance[]></TD>
<TD>Web Site Maintenance</TD>
</TR>
<TR class="weak">
<TD><INPUT id=database type=checkbox value=yes
name=database[]></TD>
<TD>Database Capabilities</TD>
<TD><INPUT id=redesign type=checkbox value=yes
name=redesign[]></TD>
<TD>Web Site Redesign</TD>
</TR>
<TR class="weak">
<TD><INPUT id=logo type=checkbox value=yes
name=logo[]></TD>
<TD>Logo Design</TD>
<TD><INPUT id=seo type=checkbox value=yes
name=seo[]></TD>
<TD>Search Engine Optimization </TD>

The is no such thing as a PHP checkbox, PHP is just used to "create" the HTML.
Looking at what you have above, why do all the names of the fields have brackets "[]" after them? The other thing that is missing is the code that you are using to generate the email.
try removing the brackets first (as those are used for arrays!) and see if that works. If not, give a sample of the code that produces the email.
Michael J

Michael, here is the php code to send it to my email. Everything comes ok except the checkbox which like i said before comes back as Aray,Aray,Aray
<?
function checkOK($field)
{
if (eregi("\r",$field) || eregi("\n",$field)){
die("Invalid Input!");
}
}
$webhosting=$_POST['webhosting'];
checkOK($webhosting);
$marketing=$_POST['marketing'];
checkOK($marketing);
$webdesign=$_POST['webdesign'];
checkOK($webdesign);
$cemail=$_POST['cemail'];
checkOK($cemail);
$Maintenance=$_POST['Maintenance'];
checkOK($Maintenance);
$database=$_POST['database'];
checkOK($database);
$redesign=$_POST['redesign'];
checkOK($redesign);
$logo=$_POST['logo'];
checkOK($logo);
$seo=$_POST['seo'];
checkOK($seo);$to="BigShow@email.com";
$message="$name just filled in your comments form. They said:\n$comments\n\nTheir e-mail address was: $email\n
Required Services:$webhosting,$marketing,$webdesign,$cemail,$Maintenance,$database,$redesign,$logo,$seo\n
Project Description:$p_description\n
Number of Pages:$numpages\n
Budget:$budget\n
Start Date:$startdate\n
Completion Date:$comp,$compyear\n
Current URL:$url\n
Contact:$contact\n";
if(mail($to,"Comments From Your Site",$message,"From: $email\n")) {
echo "Thanks for your comments.";
} else {
echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
}
?>

Michael, I actually figures it out, I have to change the value from YES to what they represented. I think I was originally doing an array then changed half way through. Thanks once again for helping though.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |