Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php]skrypt logowania - pomoc
Adrianz
post
Post #1





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 3.02.2008

Ostrzeżenie: (0%)
-----


witam ,mam problem ze skryptem,myślę że wszystko zrobiłem dobrze a tutaj zaskakuje mnie błąd :
CODE
Parse error: parse error, unexpected T_ELSE in E:\APACHE\httpd\projekt\login.php on line 38




Możliwe iż pominąłem jakis { lub }

To jest kod skryptu na logowanie się
CODE


<?php require_once("inc/session.php"); ?>
<?php require_once("inc/connection.php"); ?>
<?php require_once("inc/functions.php"); ?>
<?php
include_once("inc/ffunctions.php");
if (isset($_POST['submit'])) {
$errors = array();
$required_fields = array('user', 'password');
$errors = array_merge($errors, check_required_fields($required_fields,$_POST));
$fields_with_lenghts = array('user' => 16, 'password' => 12);
$errors = array_merge($errors, check_max_field_lenght($fields_with_lenghts,$_POST));
$user = trim(mysql_prep($_POST['user']));
$password = trim(mysql_prep($_POST['password']));
$h_password = md5($password);

if ( empty($errors) ) {
$query = "SELECT id, user ";
$query .= "FROM users ";
$query .= "WHERE user = '{$user}' ";
$query .= "AND h_password = '{$h_password}'";
$query .= "LIMIT 1";
$result_set = mysql_query($query);
$confirm_query = mysql_query($result_set);

if (mysql_num_rows($result_set)== 1) {
$f_user = mysql_fetch_array($result_set);
$_SESSION['user_id'] = $found_user['id'];
$_SESSION['user'] = $found_user['id'];
redirect_to("user_area.php");
} else {
if (count($errors) == 1) {
$msg = "Jedno z pól jest niepoprawne";
} else {
$msg = count($errors) "pól jest niepoprawnych";
}
{
} else {
if (isset($_GET['logout'])) && $_GET['logout'] == 1) {
$msg = "zostales poprawnie wylogowany ze strony,Miłego Dnia" ;
}
$user = "";
$password = "";
}
?>
<?php include("inc/header.php") ?>





Jeżeli jest ktoś chętny,proszę mi udzielić pomocy
Pozdrawiam

Ten post edytował Adrianz 19.08.2008, 22:19:05
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 08:38