Hey,
Well here is the problem I am having.
First, Let me show you the PHP code I have so far:
<?php
$username = "username";
$password = "pass";
$database = "db";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$company_name = "'".$_POST['company_name']."'";
$company_url = "'".$_POST['company_url']."'";
$contact_first = "'".$_POST['contact_first']."'";
$contact_last = "'".$_POST['contact_last']."'";
$contact_email = "'".$_POST['contact_email']."'";
$address_1 = "'".$_POST['address_1']."'";
$address_2 = "'".$_POST['address_2']."'";
$city = "'".$_POST['city']."'";
$zip = "'".$_POST['zip']."'";
$state = "'".$_POST['state']."'";
$country = "'".$_POST['country']."'";
$established = "'".$_POST['established']."'";
$phone = "'".$_POST['phone']."'";
$fax = "'".$_POST['fax']."'";
$info = "'".$_POST['info']."'";
$type = "'".$_POST['type']."'";
$cp = "'".$_POST['cp']."'";
$support = "'".$_POST['support']."'";
$payment = "'".$_POST['payment']."'";
if($_GET['action'] == "add")
{
$query = "INSERT INTO host (host_id, company_name, company_url,
contact_first, contact_last, contact_email,
address_1, address_2, city, zip, state,
country, established, phone, fax, info,
type, cp, support, payment)
VALUES ('', $company_name, $company_url,
$contact_first, $contact_last, $contact_email,
$address_1, $address_2, $city, $zip, $state,
$country, $established, $phone, $fax, $info,
$type, $cp, $support, $payment)";
mysql_query($query);
}
mysql_close();
?>
And here is the signup page that this script belongs to:
http://www.findagoodhost.com/host_signup.php
Now everything works fine, till I reach the checkboxes (starting at "platform supported").
How do I insert the corresondong checked values in the db? I have 1 field ('platform') in the host table, and I need to place all the checked values in that field. So how do I do that in the code above?
I was thinking of doing something like, if the Visa check box has been checked:
if (isset($_POST['paymentVisa']) && $_POST['paymentVisa'] == 'checked')
where paymentVisa is the name of that checkbox.
but I don't know where to put that code, and how to add the other checkboxes should they've been checked.
Any help would greatly be appreciated.
Thank you