Neo_choveka
Registered
такамм.. избрах тази рег :
http://web-tourist.net/login/login/view.php?st=802
обаче когато напиша в сайта http://saita/register.php и ми излиза :
Parse error: syntax error, unexpected T_STRING in /var/www/virtual/deathzone.redpicasso.com/htdocs/register/config.php on line 4
а ето и кода на register.php
http://web-tourist.net/login/login/view.php?st=802
обаче когато напиша в сайта http://saita/register.php и ми излиза :
Parse error: syntax error, unexpected T_STRING in /var/www/virtual/deathzone.redpicasso.com/htdocs/register/config.php on line 4
а ето и кода на register.php
Код:
<?php
ob_start();
// allows you to use cookies
include("config.php");
//gets the config page
if ($_POST[register]) {
// the above line checks to see if the html form has been submitted
$username = $_POST[username];
$password = $_POST[pass];
$cpassword = $_POST[cpass];
$email = $_POST[emai1];
//the above lines set variables with the user submitted information
if($username==NULL|$password==NULL|$cpassword==NULL|$email==NULL) {
//checks to make sure no fields were left blank
echo "A field was left blank.";
}else{
//none were left blank! We continue...
if($password != $cpassword) {
// the passwords are not the same!
echo "Passwords do not match";
}else{
// the passwords are the same! we continue...
$password = md5($password);
// encrypts the password
$checkname = mysql_query("SELECT username FROM users WHERE username='$username'");
$checkname= mysql_num_rows($checkname);
$checkemail = mysql_query("SELECT email FROM users WHERE email='$email'");
$checkemail = mysql_num_rows($checkemail);
if ($checkemail>0|$checkname>0) {
// oops...someone has already registered with that username or email!
echo "The username or email is already in use";
}else{
// noone is using that email or username! We continue...
$username = htmlspecialchars($username);
$password = htmlspecialchars($password);
$email = htmlspecialchars($email);
// the above lines make it so that there is no html in the user submitted information.
//Everything seems good, lets insert.
$query = mysql_query("INSERT INTO users (username, password, email) VALUES('$username','$password','$email')");
// inserts the information into the database.
echo "You have successfully registered!";
}
}
}
}
else
{
// the form has not been submitted...so now we display it.
echo ("
<center>
<form method=\"POST\">
Потребителско име: <input type=\"text\" size=\"15\" maxlength=\"25\" name=\"username\"><br />
Парола: <input type=\"password\" size=\"15\" maxlength=\"25\" name=\"pass\"><br />
Повторете паролата: <input type=\"password\" size=\"15\" maxlength=\"25\" name=\"cpass\"><br />
Email адрес: <input type=\"text\" size=\"15\" maxlength=\"25\" name=\"emai1\"><br />
<input name=\"register\" type=\"submit\" value=\"Регистрирай се\">
</form>
</center>
");
}
?>