Click to See Complete Forum and Search --> : PHP Connection Problem


kylix
12-08-2005, 06:10 PM
Hello all....I'm getting this error from my page
Parse error: parse error, unexpected '=' in /www/c/cccompany/htdocs/registration.php on line 4
What am I doing wrong? Line 4 is dbhost = "mysql15.powweb.com";
//Database Information

dbhost = "mysql15.powweb.com";
dbname = "cccompany_info";
dbuser = "cccomany28";
dbpass = "-------";

//Connect to database

mysql_connect (mysql15.powweb.com, cccomany28, -------)or die("Could not connect: ".mysql_error());
mysql_select_db(cccompany_info) or die(mysql_error());

SpectreReturns
12-08-2005, 06:19 PM
Variables in PHP are preceded by a money sign ($).

kylix
12-08-2005, 06:30 PM
sorry that was the wrong code I posted......here is the correct one
<title>Registration Test</title><?PHP

//Database Information

$dbhost = "mysql15.powweb.com";
$dbname = "cccompany_info";
$dbuser = "cccomany28";
$dbpass = "-----";

//Connect to database

mysql_connect ($dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());



$name = $_POST['name'];
$email = $_POST['email'];
$username = $_POST['username'];
$password = md5($_POST['password']);

// lets check to see if the username already exists

$checkuser = mysql_query("SELECT username FROM users WHERE username='$username'");

$username_exist = mysql_num_rows($checkuser);

if($username_exist > 0){
echo "I'm sorry but the username you specified has already been taken. Please pick another one.";
unset($username);
include 'register.html';
exit();
}

// lf no errors present with the username
// use a query to insert the data into the database.

$query = "INSERT INTO users (name, email, username, password)
VALUES('$name', '$email', '$username', '$password')";
mysql_query($query) or die(mysql_error());
mysql_close();

echo "You have successfully Registered";

// mail user their information

$yoursite = ‘www.Msusaonline.com’;
$webmaster = ‘Alpha’;
$youremail = ‘dnice006@aol.com’;

$subject = "You have successfully registered at $yoursite...";
$message = "Dear $name, you are now registered at our web site.
To login, simply go to our web page and enter in the following details in the login form:
Username: $username
Password: $password

Please print this information out and store it for future reference.

Thanks,
$webmaster";

mail($email, $subject, $message, "From: $yoursite <$youremail>\nX-Mailer:PHP/" . phpversion());

echo "Your information has been mailed to your email address.";

?>

My error is Parse error: parse error, unexpected '@' in /www/c/cccompany/htdocs/register.php on line 49. Line 49 is $youremail = ‘dnice006@aol.com’;
I have no clue, what I'm doing wrong, thanks for any help.

kylix
12-08-2005, 07:11 PM
I got it to work, thanks for helping guys!