Hi, thank its working now.
another question, what would i have to do to make the same information going into the MySQL DB also be sent as an email? and then let the user be directed to a payment page, or a signup error?
so far ive come up with this:
<?php
if ($_POST['name'] != "" && $_POST['contact'] && $_POST['paypal'] && $_POST['domain'] && $_POST['username'] && $_POST['password'] ) {
$subject="You Have A New Customer Sign-Up!";
$name=$_POST['name'];
$address=$_POST['address'];
$line1=$_POST['line1'];
$line2=$_POST['line2'];
$postcode=$_POST['postcode'];
$county=$_POST['county'];
$country=$_POST['country'];
$phone=$_POST['phone'];
$contact=$_POST['contact'];
$paypal=$_POST['paypal'];
$domain=$_POST['domain'];
$username=$_POST['username'];
$password=$_POST['password'];
$plan=$_POST['plan'];
$comments=$_POST['comments'];
$ip=$_SERVER["REMOTE_ADDR"];
$host = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$host = $ip.".".$host;
$mon=date(m);
$day=date(j);
$year=date(y);
$hour=date(g);
$min=date(i);
$sec=date(s);
$hour=$hour-2;
if($hour<=0) { $hour+=12; }
$ts = "$hour:$min:$sec on $day/$mon/$year";
$to="$orders_email";
$body="
Your Name = $name
Address = $address
Line 1 = $line1
Line 2 = $line2
Post Code = $postcode
County = $county
Country = $country
Phone = $phone
Contact E-Mail Address = $contact
Paypal E-Mail Address = $paypal
Your Domain Name = $domain
Requested User Name = $username
Requested Password = $password
Plan = $plan
Additional Comments = $comments
Host: $host
Time: $ts";
$email = "From: $site_title Sign-up Form <$to>";
mail($to, $subject, $body, $email);
$db=mysql_connect("localhost", "unlimite_customers", "******") or die("Could not connect to localhost."); mysql_select_db("unlimite_customers", $db) or die("Could not find customers.");
$querySQL = "INSERT INTO `customers`
(`name`, `address`, `line1`, `line2`, `postcode`, `county`, `country`, `phone`, `contact`, `paypal`, `domain`, `username`, `password`, `plan`, `comments`)
VALUES
('$name', '$address', '$line1', '$line2', '$postcode', '$county', '$country', '$phone', '$contact', '$paypal', '$domain', '$username', '$password', '$plan', '$comments')";
mysql_query($querySQL) or die(mysql_error());
?>
<?
include_once "template/header.html";
include_once "body/signup_pay.html";
include_once "template/footer.html";
?>
<?php
} else {
?>
<?
include_once "template/header.html";
include_once "body/signup_error.html";
include_once "template/footer.html";
?>
<?
}
?>
but it hasnt worked!
anyone know why? i cant figure it out.
regards
SS