Parse error: syntax error, unexpected T_STRIN

Résolu
Bonjour,

Je suis entraint de faire un site tout marche bien mais quand je meut connecte vers login.php

Sa meut met sa :

Parse error: syntax error, unexpected T_STRING in /home/spaceinfini/html/login.php on line 45

Mon code de login.php est sa:

a la ligne 45 c'est sa:

"!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

LIGNE 45----------> html xmlns= "http://www.w3.org/1999/xhtml'xml:lang="fr" ;

Merci de votre reponse
Configuration: Windows XP
Firefox 3.5

9 réponses

  1. Voici le code

     <?php
    
    /**
     * login.php
     *
     * @version 1.0
     * @copyright 2008 by ?????? for XNova
     */
    
    define('INSIDE'  , true);
    define('INSTALL' , false);
    define('LOGIN'   , true);
    
    $InLogin = true;
    
    $xnova_root_path = './';
    include($xnova_root_path . 'extension.inc');
    include($xnova_root_path . 'common.' . $phpEx);
    
    	includeLang('login');
    
    	if ($_POST) {
    		$login = doquery("SELECT * FROM {{table}} WHERE `username` = '" . mysql_escape_string($_POST['username']) . "' LIMIT 1", "users", true);
            if($login['banaday'] <= time() & $login['banaday'] !='0' ){
                doquery("UPDATE {{table}} SET `banaday` = '0', `bana` = '0', `urlaubs_modus` ='0'  WHERE `username` = '".$login['username']."' LIMIT 1;", 'users');
             doquery("DELETE FROM {{table}} WHERE `who` = '".$login['username']."'",'banned');
          } 
    
    		if ($login) {
    			if ($login['password'] == md5($_POST['password'])) {
    				if (isset($_POST["rememberme"])) {
    					$expiretime = time() + 31536000;
    					$rememberme = 1;
    				} else {
    					$expiretime = 0;
    					$rememberme = 0;
    				}
    
    				@include('config.php');
    				$cookie = $login["id"] . "/%/" . $login["username"] . "/%/" . md5($login["password"] . "--" . $dbsettings["secretword"]) . "/%/" . $rememberme;				
                                                                         setcookie($game_config['COOKIE_NAME'], $cookie, $expiretime, "/", "", 0);
    
    				unset($dbsettings);
    "!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    html xmlns= "http://www.w3.org/1999/xhtml'xml:lang="fr" ;
                                       header("Location: ./frames.php");
    				exit;
    			} else {
    				message($lang['Login_FailPassword'], $lang['Login_Error']);
    			}
    		} else {
    			message($lang['Login_FailUser'], $lang['Login_Error']);
    		}
    	} else {
    		$parse                 = $lang;
    		$Count                 = doquery('SELECT COUNT(*) as `players` FROM {{table}} WHERE 1', 'users', true);
    		$LastPlayer            = doquery('SELECT `username` FROM {{table}} ORDER BY `register_time` DESC', 'users', true);
    		$parse['last_user']    = $LastPlayer['username'];
    		$PlayersOnline         = doquery("SELECT COUNT(DISTINCT(id)) as `onlinenow` FROM {{table}} WHERE `onlinetime` > '" . (time()-900) ."';", 'users', true);
    		$parse['online_users'] = $PlayersOnline['onlinenow'];
    		$parse['users_amount'] = $Count['players'];
    		$parse['servername']   = $game_config['game_name'];
    		$parse['forum_url']    = $game_config['forum_url'];
    		$parse['PasswordLost'] = $lang['PasswordLost'];
    
    		$page = parsetemplate(gettemplate('login_body'), $parse);
    
    		// Test pour prendre le nombre total de joueur et le nombre de joueurs connectés
    		if ($_GET['ucount'] == 1) {
    			$page = $PlayersOnline['onlinenow']."/".$Count['players'];
    			die ( $page );
    		} else {
    			display($page, $lang['Login']);
    		}
    	}
    
    // -----------------------------------------------------------------------------------------------------------
    // History version
    
    ?>
    
    1. une boucle que tu as mal fermée, un quote manquant, ça peut etre pas mal de chose met nous toute la page stp
      1. Salut,

        Je ne vois pas ce que viennent faire ces lignes ici:
        "!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
        html xmlns= "http://www.w3.org/1999/xhtml'xml:lang="fr" ;
        


        Ce n'est pas du code PHP et en admettant que tu voulais l'envoyer au client ca empercherait le header venant après de fonctionner.
        1. Ok merci de ta réponse je lai enlever et quand j'ai été sur ma page sa ma mit sa

          Warning: Cannot modify header information - headers already sent by (output started at /home/spaceinfini/html/login.php:1) in /home/spaceinfini/html/login.php on line 41

          Warning: Cannot modify header information - headers already sent by (output started at /home/spaceinfini/html/login.php:1) in /home/spaceinfini/html/login.php on line 44
          1. Tu dois avoir un caractère avec le <?php il ne faut rien du tout avant pas même un espace ou un saut de ligne.
            1. Maintenant ca meut met ca

              
              Fatal error: Call to undefined function phpsetcookie() in /home/spaceinfini/html/login.php on line 41
              1. dsl il y avait marquer ca :

                Warning: Cannot modify header information - headers already sent by (output started at /home/spaceinfini/html/includes/functions/CheckCookies.php:1) in /home/spaceinfini/html/login.php on line 41

                Warning: Cannot modify header information - headers already sent by (output started at /home/spaceinfini/html/includes/functions/CheckCookies.php:1) in /home/spaceinfini/html/login.php on line 44
                1. Ta première ligne envoie toujours du texte au client, vérifie bien qu'il n'y à aucuns caractères à part <?php dessus même pas d'espace.
                  Si ton fichier est enregistrer en UTF8 essai en UTF8 sans BOM (différent suivant ton éditeur)