I am new to php and been following various youtube tutorials and boought a few books, I am now however clueless with my latest error and really need some help.
This is my error Parse error: syntax error, unexpected T_STRING unexpected '?' in /web/com/138601040918006/main.php on line 17

Please have a look at my code and advise where I am going wrong. I had a feeling is my my files and because the website is uploaded its in a subdirectory but on Xampp its the main one and on localhost. So not sure.

Thanks in advance

`

<html>
<head>
<title>Online PHP Script Execution</title>
</head>
<body>
<html>
<body>
<?php

function fact($n){
if($n==0)
{return 1;} 
else {
$i = $a = 1

<?php //démarrer une session
session_start();
$loginOK=false;
?>
<html>
<html>
<head></head>
<body TEXT=#000000 bgcolor="#000000">
<?php
//appel au fonctions.php (la fonction connexion())
require_once('fonction.php');
if ( isset($_POST) && (!empty($_POST['pseudo'])) && (!empty($_POST['password'])) )
{extract($_POST);$pseudo = $_POST['pseudo'];
$password = $_POST['password'];
if(connexion())
{//verification de login$req="select * from etudient where login='$pseudo'";$resultat=mysql_query($req) or die("connexion impossible");
$num_row=mysql_num_rows($resultat);
if( $num_row == 1 && !mysql_error())
{$data = mysql_fetch_assoc($resultat);
//verification de mot de passeif ($password == $data["pass"]){$loginOK = true;print "<br><br><br><br><center>";
print "<table border=\"2\" width=\"600\" bordercolor=\"gray\"background=\"OK.png;
print "<tr>";
print "<td bordercolor=\"#f9e56d\">";print "<center>";
print "<center><h1><tt><br><br><br>Vous êtes bien identifié";
print "<BR>";
echo "bonjour monsieur ";
echo $data["pre_etu"] ;
print " ";
echo $data["nom_etu"];print "<BR>";
echo "Redirection vers paged'acceuil dans 2 seconde.";
print "<BR>";
echo "appuyé <A HREF =\"choix.php\"> ici </A> pour continuer...";
print "<br><br><br><br><br></h1>";
print "</form>";print "</td>";
print "</tr>";print "</table>"
;?><meta http-equiv="refresh" content="3;
 URL=choix.php"><?}}}if ($loginOK){
// si les données sont justes on recupère les information sur l'etudient tous le long de session$_SESSION['login'] = $data["login"];
$_SESSION['nom'] = $data["nom_etu"];
$_SESSION['pre'] = $data["pre_etu"];
$_SESSION['id'] = $data["id_etu"];
}else{//les données incorrectes
echo 'Une erreur est survenue, 
veuillez réessayer !';
print "<br><br><br><br><center>";
print "<table border=\"2\" width=\"535\" bordercolor=\"gray\" background=\"stop-1.jpg\">";
print "<tr>";
print "<td bordercolor=\"#f9e56d\">";
print "<center>";
print "<center><h1><tt><br><br><br><br> Vérifier votre demande";
print "<br> <br> </ h1>";
print "< / form> ";
 print "</ td>";
 print "</ tr>";
 print "</ table>";
 ?>
 </ center> 
<meta http-equiv = "refresh" content = "3; URL = index.php "> <? } ?>
 </ body> 
</ html>

;
while ($i<=$n){
$a = $a * $i;
$i++;

}
return ($a);
}
}
$x=8;
$nbr=fact($x);
echo " Le factoriel de $x est égale à $nbr";
?>
</body>
</html>

</body>
</html>
Member Avatar
diafol
...HTML STUFF...!
<?php
function fact($n){
if($n==0)
{return 1;} 
else {
$i = $a = 1
<?php //démarrer une session
session_start();
$loginOK=false;

For some reason you have an open php tag, followed by another open php tag. Take out the second one. Also it's good practice to get most of your php out of the way above the HTML (!doctype declaration).

commented: thx :) +0
Member Avatar
diafol

Ghaddab: thx :)

Well thanks for the neg rep I guess.