neojack | yep the people,
Code :
- <?
- require("conf.php" );
- // CONNEXION MYSQL
- $db_link = @mysql_connect($sql_serveur,$sql_user,$sql_passwd);
- if(!$db_link) {echo "Connexion impossible à la base de données <b>$sql_bdd</b> sur le serveur <b>$sql_server</b><br>Vérifiez les paramètres du fichier conf.php3"; exit;}
- // SELECTION DE L'ENREGISTREMENT CONTENANT L'ID EN COURS
- $requete=mysql_db_query($sql_bdd,"select * from membre where id=\"$id\"",$db_link) or die(mysql_error());
- // SI L'ID N'EXISTE PAS
- if(mysql_num_rows($requete)==0)
- {
- // REDIRECTION PAGE ERREUR
- header("Location:$url_erreur" );
- exit;
- }
- // LIGNE FACULTATIVE : RECUPERATION DU PSEUDO
- $pseudo_membre=mysql_result($requete,0,"pseudo" );
- // CHAMPS SUPLEMENTAIRES
- // Si vous avez ajouté des champs dans la table SQL, inspirez-vous de la ligne précédente pour récupérer leur valeur.
- //$email=mysql_result($requete,0,"email" );
- //$ville=mysql_result($requete,0,"ville" );
- // DECONNEXION MYSQL
- mysql_close($db_link);
- ?>
- <html>
- <head>
- <style>
- BODY{
- scrollbar-face-color:'#0B391C';
- scrollbar-arrow-color:'#FFFFFF';
- scrollbar-track-color:'#0B391C';
- scrollbar-shadow-color:'#FFFFFF';
- scrollbar-highlight-color:'#FFFFFF';
- scrollbar-3dlight-color:'#FFFFFF';
- scrollbar-darkshadow-Color:'#FFFFFF';
- }
- </style>
- <link REL='StyleSheet' TYPE='text/css' HREF='theme/fstyle.css'>
- <link REL='StyleSheet' TYPE='text/css' HREF='theme/fstyle.css'>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <link REL='StyleSheet' TYPE='text/css' HREF='theme/fstyle.css'>
- </head>
- <body bgcolor="0B391B" >
- <table border='0' cellpadding='0' cellspacing='0' width='915' height='605' align='center'>
-
- <tr>
- <td align="left" valign="top" width="229" rowspan="5" height="605">
- <br>
-
- <table width='200' border='0' cellpadding='0' cellspacing='0'>
- <tr>
-
- <td background="images/mh.jpg" border="0" width="200" height="30" valign="middle">
- <div align="center"><font class="menu">.:: Menu de navigation ::.</div></font>
- </td>
- </tr>
- <tr>
- <td background='images/mm.jpg'>
- <font class='textnormal'>
- <div align='center'>
- <table width='75%' align='center' border='0'>
- <tr>
- <td width='50%' valign='bottom' align='center'><font class='textnormal'><br><b>Bienvenue</b><br><a class='menulien' href='pbas.php' target='_self'><br>> Accueil <</a><br>
- <a class='menulien' href='histoire.php' target='_self'><br>> Histoire de la troupe <</a><br>
- <a class='menulien' href='membres.php' target='_self'><br>> Membres <</a><br>
- <a class='menulien' href='fede.php' target='_self'><br>> La fédération <</a><br>
- <a class='menulien' href='loi.php' target='_self'><br>> La loi et la promesse<br>scoute <</a><br>
- <a class='menulien' href='calendrier.php' target='_self'><br>> Le calendrier <</a><br>
- <a class='menulien' href='photos.php' target='_self'><br>> Les photos <</a><br>
- <a class='menulien' href='liens.php' target='_self'><br>> Les liens <</a><br>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>
- <img src='images/mb.jpg' border='0' alt='' width="200" height="25"></td>
- </tr>
- </table>
- <table width='200' border='0' cellpadding='0' cellspacing='0'>
- <tr>
- <td background='images/mh.jpg' border='0' width='200' height='29' valign='middle'>
- <div align="center"><font class="menu">.:: Se connecter ::.</div></font>
- </td>
- </tr>
- <tr>
- <td background='images/mm.jpg'>
- <font class='textnormal'>
- <div align="center">
- <br>
- <a class='menulien' href="profil.php?id=<? echo "$id"; ?>" target="_self"> <img src='images/compte.gif' border='0' width="29" height="33"></a>
- <a class="menulien" href="profil.php?id=<? echo "$id"; ?>" target="_self"><br> > Mon profil <</a><br><br>
- <a class="menulien" href="upphotos.php?id=<? echo "$id"; ?>" target="_self"> > Uploader des photos <</a>
- </div>
- <div align="center">
-
- </div>
- </font>
- </td>
- </tr>
- <tr>
- <td>
- <img src='images/mb.jpg' border='0' alt='' width="200" height="25"></td>
- </tr>
- </table>
- <table width='200' border='0' cellpadding='0' cellspacing='0'>
- <tr>
- <td background='images/mh.jpg' border='0' width='200' height='29' valign='middle'>
- <div align="center"><font class="menu">.:: Infos ::.</div></font>
- </td>
- </tr>
- <tr>
- <td background='images/mm.jpg'>
- <font class='textnormal'>
- <div align='center'>
- </div>
- </font>
- </td>
- </tr>
- <tr>
- <td>
- <img src='images/mb.jpg' border='0' alt='' width="200" height="25"></td>
- </tr>
- </table>
-
-
-
- <td align="left" valign="top" width="596" height="21" colspan="4">
- <td align="left" valign="top" width="90" rowspan="5" height="605">
- <font class='textnormal'><tr>
- <td align="left" valign="top" width="23" height="584">
- <td align="left" valign="top" width="540" height="584">
- <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 height="94">
- <TR>
- <TD width=23 height=12>
- <img border="0" src="images/bashg.jpg" width="23" height="29"></TD>
- <TD width="100%" background=images/bashm.jpg height=12></TD>
- <TD width=23 height=26>
- <img border="0" src="images/bashd.jpg" width="23" height="29"></TD></TR>
- <TR>
- <TD width=23 background=images/basmg.jpg height="1"></TD>
- <TD width="100%" bgColor=white height="73">
- <DIV align=center style="width: 715; height: 157"><BR><img border="0" src="images/line.gif" width="333" height="9">
- <p><img border="0" src="images/ordi.gif" width="34" height="33"></p>
- <?php
- /* loading language file */
- function get_translations($lngfile) {
- if (file_exists($lngfile)) {
- $lines = file($lngfile);
- while (list(,$line) = each($lines)) {
- list($key,$val)= explode("=",$line);
- $phrases[$key] = $val;
- }
- return $phrases;
- } else {
- return false;
- }
- }
- /* translate a string */
- function translate($str,$vals="" ) {
- global $phrases;
- if ($phrases) {
- $p_str = $phrases[$str];
- if ($p_str == "" ) {
- $p_str = $str;
- }
- } else {
- $p_str = $str;
- }
- if (gettype($vals)=="array" ) {
- $p_str = sprintf($p_str,$vals[0],$vals[1],$vals[2],$vals[3],$vals[4],$vals[5],$vals[6]);
- }
- return (trim($p_str));
- }
- $my_max_file_size = "102400"; # in bytes
- $image_max_width = "800";
- $image_max_height = "800";
- $the_path = "upimages/";
- $registered_types = array(
- "application/x-gzip-compressed" => ".tar.gz, .tgz",
- "application/x-zip-compressed" => ".zip",
- "application/x-tar" => ".tar",
- "text/plain" => ".html, .php, .txt, .inc (etc)",
- "image/bmp" => ".bmp, .ico",
- "image/gif" => ".gif",
- "image/pjpeg" => ".jpg, .jpeg",
- "image/jpeg" => ".jpg, .jpeg",
- "application/x-shockwave-flash" => ".swf",
- "application/msword" => ".doc",
- "application/vnd.ms-excel" => ".xls",
- "application/octet-stream" => ".exe, .fla (etc)"
- );
- $allowed_types = array("image/bmp","image/gif","image/pjpeg","image/jpeg" );
- # --
- function form($error=false) {
- global $PHP_SELF,$my_max_file_size,$lng;
- if ($error) print $error . "<br><br>";
- print "\n<form ENCTYPE="multipart/form-data" action="upphotos.php?id=<? echo $id; ?>" method="post">";
- print "\n<INPUT TYPE=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"" . $my_max_file_size . "\">";
- print "\n<INPUT TYPE=\"hidden\" name=\"task\" value=\"upload\">";
- print "\n<P>".translate("Upload images" )."";
- print "\n<BR>NOTE: ".translate("Max file size is" )." " . ($my_max_file_size / 1024) . "KB";
- print "\n<br><INPUT NAME=\"the_file\" TYPE=\"file\" SIZE=\"35\"><br>";
- print "\n<input type=\"submit\" Value=\"Upload\">";
- print "\n</form>";
- } # END form
- # --
- if (!ereg("^4",phpversion())) {
- function in_array($needle,$haystack) { # we have this function in PHP4, so for you PHP3 people
- for ($i=0; $i < count($haystack); $i++) {
- if ($haystack[$i] == $needle) {
- return true;
- }
- }
- }
- }
- # --
- function validate_upload($the_file) {
- global $my_max_file_size, $image_max_width, $image_max_height,$allowed_types,$the_file_type,$registered_types;
- $start_error = "\n<b>Error:</b>\n<ul>";
- if ($the_file == "none" ) { # do we even have a file?
- $error .= "\n<li>You did not upload anything!</li>";
- } else { # check if we are allowed to upload this file_type
- if (!in_array($the_file_type,$allowed_types)) {
- $error .= "\n<li>The file that you uploaded was of a type that is not allowed, you are only
- allowed to upload files of the type:\n<ul>";
- while ($type = current($allowed_types)) {
- $error .= "\n<li>" . $registered_types[$type] . " (" . $type . " )</li>";
- next($allowed_types);
- }
- $error .= "\n</ul>";
- }
- if (ereg("image",$the_file_type) && (in_array($the_file_type,$allowed_types))) {
- $size = GetImageSize($the_file);
- list($foo,$width,$bar,$height) = explode("\"",$size[3]);
- if ($width > $image_max_width) {
- $error .= "\n<li>Your image should be no wider than " . $image_max_width . " Pixels</li>";
- }
- if ($height > $image_max_height) {
- $error .= "\n<li>Your image should be no higher than " . $image_max_height . " Pixels</li>";
- }
- }
- if ($error) {
- $error = $start_error . $error . "\n</ul>";
- return $error;
- } else {
- return false;
- }
- }
- } # END validate_upload
- # --
- function list_files() {
- global $the_path;
- $handle = dir($the_path);
- print "\n<b>Uploaded files:</b><br>";
- while ($file = $handle->read()) {
- if (($file != "." ) && ($file != ".." )) {
- print "\n" . $file . "<br>";
- }
- }
- print "<hr>";
- }
- # --
- function upload($the_file) {
- global $the_path,$the_file_name;
- $error = validate_upload($the_file);
- if ($error) {
- form($error);
- } else { # cool, we can continue
- if (!@copy($the_file, $the_path . "/" . $the_file_name)) {
- form("\n<b>Something barfed, check the path to and the permissions for the upload directory</b>" );
- } else {
- list_files();
- form();
- }
- }
- } # END upload
- # --;
- ############ Start page
- echo("<table width=\"0%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">
- <tr align=\"left\">
- <td><font face=verdana size=2>" );
- switch($task) {
- case 'upload':
- upload($the_file);
- break;
- default:
- form();
- }
- echo("</font></td>
- </tr>
- </table>" );
- ?>
- <p><img border="0" src="images/line.gif" width="333" height="9"></p>
- <p> </DIV></TD>
- <TD width=23 background=images/basmd.jpg height="73"></TD></TR>
- <TR>
- <TD width=23 background=basbg.gif height=29>
- <img border="0" src="images/basbg.jpg" width="23" height="29"></TD>
- <TD width="100%" background=images/basgm.jpg height=29></TD>
- <TD width=23 background=basbd.gif
- height=29><img border="0" src="images/basbd.jpg" width="23" height="29"></TD></TR></TABLE>
- <td align="left" valign="top" width="6" height="584">
- </table>
- </body>
- </html>
|
car j'ai ce message d'erreur : Code :
- Parse error: parse error, unexpected T_STRING in d:\nicolas\siteweb\160\upphotos.php on line 285
|
bizarre pourtant moi je vois pas d'erreur dedans ... |