hi all im Gavin Hanson as anyone who helped me before should know i like this site and i really wanna know if its capable of what i think it is so lets see if it lives up to the reputation.
i have recently bought a server for a web hosting company and i need a sign up form within 2 hours from now because i have a load of people wanting hosting and saying there gonna walk now as a new bussiness what needs to pay for itself that isnt good so here is the code i have pushed togeather can you help me ?
this is my form...
<form name="links" method="post" action="add_customer.php">
<p>Your Name:
<input type="text" name="yname">
<br>
<br>
Address Line 1:
<input type="text" name="ad1">
<br>
<br>
Address Line 2:
<input type="text" name="ad2">
<br>
<br>
Town/City:
<input type="text" name="tc">
<br>
<br>
State/Province:
<input type="text" name="sp">
<br>
<br>
Country:
<input type="text" name="cty">
<br>
<br>
Postal Code/zip:
<input type="text" name="zip">
<br>
<br>
Telephone Number:
<input type="text" name="pno">
<br>
<br>
E-Mail Address:
<input type="text" name="eml">
<br>
<br>
E-Mail Address (Verify):
<input type="text" name="emlv">
<br>
<br>
Payment Method:
<input type="text" name="payment"> Paypal, Cash/Cheque, other email <a href="mailto:sales@host-unit.com">Sales@Host-Unit.com</a>
<br>
<br>
Domain Name:
<input type="text" name="dmn"> Please Specify in "www.yourname.com" format "domains include ".com" ".co.uk" ".net" ".org" ".biz" Some Domains Follow An Aditional Fee.
<br>
<br>
Wanted UserName:
<input type="text" name="userid">
<br>
<br>
Password:
<input type="text" name="pw">
<br>
<br>
Password (Verify):
<input type="text" name="pwv">
<br>
<br>
Hosting Package:
<input type="text" name="pack">
<br>
<br>
Other Quick Notes:<br>
<textarea rows=5 cols=20 wrap="off" name="nts"></textarea>
<p>
<input type="submit" name="Submit" value="Submit">
</p></form>
this is my action script for the form "add_customer.php"
<?php
include "config.php";
$db = mysql_connect($db_host,$db_user,$db_pass);
mysql_select_db ($db_name) or die ("Cannot connect to database");
$query = "INSERT INTO new_customers (id, yname, ad1, ad2, tc, sp, cty, zip, pno, eml, emlv, payment, dmn, userid, pw, pwv, pack, nts)
VALUES('','".$_POST['yname']."','".$_POST['ad1']."', '".$_POST['ad2']."', '".$_POST['tc']."', '".$_POST['sp']."', '".$_POST['cty']."', '".$_POST['zip']."', '".$_POST['pno']."', '".$_POST['eml']."', '".$_POST['emlv']."', '".$_POST['payment']."', '".$_POST['dmn']."', '".$_POST['userid']."' '".$_POST['pw']."' '".$_POST['pwv']."' '".$_POST['pack']."' '".$_POST['nts']."' )";
$result = mysql_query($query);
if (!mysql_affected_rows()){
echo ("Recruit NOT Added.\nQuery $query is wrong");
$query=mysql_query("SELECT * FROM new_customers");
$count=mysql_num_rows($query);
echo "There are $count rows in the database";
}
else {
echo ("Thank You You Have Been Entered Into The New Customers List And Will Be Contacted By One Of Our Sales Rep's Asap");
$query=mysql_query("SELECT * FROM new_customers");
$count=mysql_num_rows($query);
echo "There are $count rows in the database";
}
?>
and finaly here is my database settings.... there all highly abrieviated so i wouldnt try to understand them...
CREATE TABLE new_customers (
id int(21) NOT NULL auto_increment,
yname text,
ad1 text,
ad2 text,
tc text,
sp text,
cty text,
zip text,
pno text,
eml text,
emlv text,
payment text,
dmn text,
userid text,
pw text,
pwv text,
pack text,
nts text,
UNIQUE KEY id (id)
) TYPE=MyISAM;
i am not being shown any errors it just isnt inserting the data into the database here is the line what i am told when i click submit form...
Thank You You Have Been Entered Into The New Customers List And Will Be Contacted By One Of Our Sales Rep's Asap
There are 0 Rows in the database
now as far as i see there is a huge problem there. i need this very very fast so please help if possible could you correct my whole code instead of just sending me the line i am not too good at finding lines and things.
thank you in advance