I did some changes, on the area to connect to my data base. but now I dont get that "You have successfully Registered" no errors and no register message. what can I do
</head>
<body>
<?php
//Database Information
$dbhost = "db2042.perfora.net";
$dbname = "db296846152";
$dbuser = "dbo296846152";
$dbpass = "jasaexim";
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
//secure data
$name = $POST['name'];
$email = $POST['email'];
$username = $POST['username'];
$emailedpass = md5($POST['password']);
//problems with imput
$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();
$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";
$yoursite = 'www.jasaexim.com';
$webmaster = 'jorge salazar';
$youremail = 'jorge.salazar@jasaexim.com';
$subject = "You have successfully registered at jasaexim,";
$message = "Dear $name, you are now registered at our web site.
To login, simply go to our web page www.jasaexim.com/login1.php
and enter in the following details in the login form:
Username: $username
Password: $emailedpass
Please print this information out and store it for future reference.
Thanks,
$webmaster";
mail($email, $subject, $message, "From: $yoursite <$youremail>\nX-Mailer😛HP/" . phpversion());
echo "your information has been mailed to your email address.";
}
?>
Here is my login.php
</head>
<body>
<?php
//Database Information
$dbhost = "db2042.perfora.net";
$dbname = "db296846152";
$dbuser = "dbo296846152";
$dbpass = "jasaexim";
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
//grab the variables from the login form and then check
session_start();
$username = $POST[‘username’];
$password = md5($POST[‘password’]);
$query = “select * from users where username=’$username’ and password=’$password’”;
$result = mysql_query($query);
//If they don’t match, display the error and the login form again
if (mysql_num_rows($result) != 1) {
$error = “Bad Login”;
include “login.html”;
//if they do match, begin the session and include the members page
} else {
$_SESSION[‘username’] = “$username”;
include “memberspage.php”;
}
?>
</body>
</html>