Page 1 sur 1

il ne marche pas. PHP erreur en lighne HTML

Posté : 23 déc. 2005, 19:03
par marli
1er! pordon pour mon francais mais Je apprenais.

le site est www.solarnova.co.uk/politica si vous voudrez il regardera.

j'ai un erreur

Parse error: parse error, unexpected $ in /usr/local/DATA/WEBSITES/2004-09/henry/cgi-bin/forum.php on line 61
MAIS le PHP est fini a ligne 56 .
j'ai eu cet erreur avent.
il'ai été un echo ne ferme pas " "

MAIS tout le echo est fermé

ici le code
<?php
/*-----------------(COMMENCE PHP)--------------*/
$from=$_GET[from];
/*-----------------($_POST /$_GET)----------*/
$htmlhead="<HTML>\n
<HEAD>\n<TITLE>The Clanwars System</TITLE>\n</HEAD>\n<body background=\"/politica/images/cwback.jpg\">
<table><tr>";
echo"$htmlhead";
echo"WARNING UNDER CONTRUCTION!! threads and post may be deleted without notice(or reason)<BR></tr><tr>";
ECHO"welcome to the forum ";ECHO($_COOKIE['user']);echo", feel free to discuss the site and the game<BR>";
/*--(prendre threads)--*/
/*--(database...threads, thread ID,thread nom)---*/

if (!$file = fopen('forumt.txt', 'rb')) {
    echo 'Error whilst opening the file.';
} else {
	
    	$threads = array();
    while (!feof($file)) {
        $theads[]= fgets($file);
	
	
    }

    fclose($file);
/*-------------------trim file----*/

$max = count($threads) - 1;

$i = 0;
while($i<=$max) :
$threads2[]=trim($threads[$i],"\x00..\x1F");
$i++;
endwhile;



/*-----------(list threads/posts)---------*/
echo"</tr><tr>";
echo"<td BGCOLOR\=gray>THREAD NO</td><td>THREAD</td></tr><tr>";

/*
$i = 0;
while($i<=$max) :
	
	
	echo"<td BGCOLOR=gray>$threads2[$i]</td>";
	$i++;
	echo"<td>$threads2[$i]</td></tr><tr>";
	$i++;
endwhile; 
*/
/*-------------(FINI PHP)--------------------*/

php?>
</tr>

<P>
</body>
</HTML>

Posté : 23 déc. 2005, 19:09
par jeff
salut
mais ton entre les balise php
ca sera plus facile a lire :wink:

Posté : 23 déc. 2005, 19:18
par Truc
Salut, la boucle while n'est pas conforme, regarde un icila syntaxe en php

Posté : 24 déc. 2005, 21:56
par marli
non,
toujourd il ne marche pas.

aussi le "while:...endwhile;" a marché avant dans un autre script.

ici le code j'ai changé:
while($i<=$max) {
$threads2[]=trim($threads[$i],"\x00..\x1F");
$i++;
}



/*-----------(list threads/posts)---------*/
echo"</tr><tr>";
echo"<td BGCOLOR\=gray>THREAD NO</td><td>THREAD</td></tr><tr>";


$i = 0;
while($i<=$max){
	
	
	echo"<td BGCOLOR=gray>$threads2[$i]</td>";
	$i++;
	echo"<td>$threads2[$i]</td></tr><tr>";
	$i++;
}
[/code]

Posté : 24 déc. 2005, 22:01
par marli
j ai il vu(cest correcte francais?)
if (!$file = fopen('forumt.txt', 'rb')) {
    echo 'Error whilst opening the file.';
} else {
    
        $threads = array();
    while (!feof($file)) {
        $theads[]= fgets($file);
    
    
    }
    }<------------------( manquer ici!!!)
    fclose($file);