Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Błąd skryptu
IceBeast
post
Post #1





Grupa: Zarejestrowani
Postów: 47
Pomógł: 0
Dołączył: 20.11.2010

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


Kod
<?php
ob_start();
require 'includes/config.php';
include('includes/templates/header.php');
session_start();

if (isset($_SESSION['user_id']) and isset($_SESSION['login']))
{
if(!isset($_GET['action']))
    {
    $_GET['action'] = 'index';
    }
switch($_GET['action'])
{
case 'password':
echo 'zmiana';
break;
case 'avatar':
if(!isSet($_FILES['new_avatar'])){
    header("Location: settings.php");
}
else{

    $uploaddir = 'upload/avatars/';
    if($_FILES['new_avatar']['error'] == UPLOAD_ERR_OK){
        $new_name = $uploaddir . $user . '.jpg';
        $temp_name = $_FILES['new_avatar']['tmp_name'];
        if(move_uploaded_file($temp_name, $new_name)){
        $query1="UPDATE user SET avatar =upload/avatars/".$_SESSION['login']." WHERE id=".$_SESSION['user_id']." "
        mysql_query($query1) or die(mysql_error());
            header("Location: settings.php");
        }
        else{
            echo 'Nieprawidłowy plik';
        }
    }
    else{
        echo 'Error';
        switch($_FILES['new_avatar']['error']){
            case UPLOAD_ERR_INI_SIZE :
            case UPLOAD_ERR_FORM_SIZE :
                echo 'Plik jest za duży!';
                break;
            case UPLOAD_ERR_PARTIAL :
                echo 'Odebrano tylko część pliku.';
                break;
            case UPLOAD_ERR_NO_FILE :
                echo 'Plik nie został pobrany!';
                break;
            default :
                echo 'Nieznany typ błędu.';
        }
    }
}        
break;
default:
echo 'ustawienia';
}
}
else
{
include('includes/pages/error/noAccess.php');
}
include('includes/templates/footer.php');
ob_end_flush();
?>



Co w powyższym kodzie jest nie tak?
Na stronie wyświetla się błąd
Kod
Parse error: syntax error, unexpected T_STRING in /home/exiliado/domains/iboard.neteasy.pl/public_html/settings.php on line 30


Więc zrobiłem błąd w zapytaniu sql, ale niestety nie wiem jakie powinno być poprawne ;x

Prosiłbym o poprawienie jeśli to możliwe.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
Daiquiri
post
Post #2





Grupa: Administratorzy
Postów: 1 552
Pomógł: 211
Dołączył: 7.07.2009
Skąd: NJ




Forum to nie parser. Zamykam.
Go to the top of the page
+Quote Post

Closed TopicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 19:38