Php + mysql

equi-monde -  
Elsyfiryos Messages postés 90 Statut Membre -
Bonjour,

J'ai codé une page, mais rien ne s'affiche. même pas une erreur "warning".

Quelqu'un de plus expérimenté pourrait-il me porter assitance?

<?php

include ('http://www.equi-monde.com/shwd/config/config.php');

$shwd_layout = mysql_query("SELECT id, nom, logo, header, fond, menu, menu_h FROM shwd_layout")or die(mysql_error()); // Requête SQL

$shwd_layout1 = mysql_fetch_array($shwd_layout);

$shwd_layout_id = $shwd_layout1 ['id'];
$shwd_layout_nom = $shwd_layout1 ['nom'];
$shwd_layout_logo = $shwd_layout1 ['logo'];
$shwd_layout_header = $shwd_layout1 ['header'];
$shwd_layout_fond = $shwd_layout1 ['fond'];
$shwd_layout_menu = $shwd_layout1 ['menu'];
$shwd_layout_menu_h = $shwd_layout1 ['menu_h'];

echo '

<html>

	<head>
	
		<title>'; $shwd_layout_nom echo '</title>
		<link href="'; $url_root echo '/config/style.css" rel="stylesheet" title="Style" />
	
	</head>
	
	<body>
	
		<div id="page" bgcolor="'; $shwd_layout_fond echo '">
			
			<span id="header">';
			
				if $shwd_layout_header =='' {
				
					echo '
					
						<table width="1000px" height="150px" border="0px" cellspacing="2" cellpadding="0">
			
							<tr>
								
								<td rowspan="3" width="200px">
									
									<div align="center">
						
										<img src="'; $shwd_layout_logo echo '" alt="'; $shwd_layout_nom echo '" href ="'; $url_root echo '" height="150" width="auto" border="0" />
									
									</div>
								
								</td>
							
								<td rowspan="3" colspan="2">
									
									<div align="center">
									
									<h1 id="header_nom">'; $shwd_layout_nom echo '</h1>
									
									</div>
								
								</td>
							</tr>
			
							<tr></tr>
							
							<tr></tr>
						
						</table>';
						
					}
				
				else {
					
					echo '
					<img src="'; $shwd_layout_header echo '" alt="'; $shwd_layout_nom echo '" href ="'; $url_root echo '" height="150" width="1000" border="0" />';
				
				}
				
				echo'
				
				</span>
				
				<span id="menu_h" style="background-color:'; $shwd_layout_menu_h echo '">
					
					<ul>
						
						<li><a href="www.google.be">Google</a></li>
						<li><a href="www.hotmail.be">Hotmail</a></li>
						<li><a href="www.reprobel.be">Reprobel</a></li>
						<li><a href="www.rtl.be">Rtl</a></li>
					
					</ul>
				
				</span> ';

?>					


D'avance, je vous remercie.

2 réponses

  1. Elsyfiryos Messages postés 90 Statut Membre 11
     
    <?php

    include ('http://www.equi-monde.com/shwd/config/config.php');

    $shwd_layout = mysql_query("SELECT id, nom, logo, header, fond, menu, menu_h FROM shwd_layout")or die(mysql_error()); // Requête SQL

    $shwd_layout1 = mysql_fetch_array($shwd_layout);

    $shwd_layout_id = $shwd_layout1['id'];
    $shwd_layout_nom = $shwd_layout1['nom'];
    $shwd_layout_logo = $shwd_layout1['logo'];
    $shwd_layout_header = $shwd_layout1['header'];
    $shwd_layout_fond = $shwd_layout1['fond'];
    $shwd_layout_menu = $shwd_layout1['menu'];
    $shwd_layout_menu_h = $shwd_layout1['menu_h'];

    ?>

    <html>

    <head>

    <title><?php echo $shwd_layout_nom ; ?></title>
    <link href="<?php echo $url_root.'/config/style.css' ; ?>" rel="stylesheet" title="Style" />

    </head>

    <body>

    <div id="page" bgcolor="<?php echo $shwd_layout_fond ; ?>">

    <span id="header">
    <?php
    if (!$shwd_layout_header) {

    ?>

    <table width="1000px" height="150px" border="0px" cellspacing="2" cellpadding="0">

    <tr>

    <td rowspan="3" width="200px">

    <div align="center">

    <img src="<?php echo $shwd_layout_logo; ?>" alt="<?php echo $shwd_layout_nom ; ?>" href ="<?php echo $url_root ?>" height="150" width="auto" border="0" />

    </div>

    </td>

    <td rowspan="3" colspan="2">

    <div align="center">

    <h1 id="header_nom"><?php echo $shwd_layout_nom ; ?></h1>

    </div>

    </td>
    </tr>

    <tr></tr>

    <tr></tr>

    </table>
    <?php
    }

    else {

    ?>
    <img src="<?php echo $shwd_layout_header; ?>" alt="<?php echo $shwd_layout_nom ; ?>" href ="<?php echo $url_root ; ?>" height="150" width="1000" border="0" />

    <?php
    }
    ?>

    </span>

    <?php
    echo '<span id="menu_h" style="background-color:'.$shwd_layout_menu_h.'';
    ?>

    <ul>

    <li><a href="www.google.be">Google</a></li>
    <li><a href="www.hotmail.be">Hotmail</a></li>
    <li><a href="www.reprobel.be">Reprobel</a></li>
    <li><a href="www.rtl.be">Rtl</a></li>

    </ul>

    </span>
    <?php

    ?>
    1
  2. OliskeN
     
    Bonjour !
    Effectivement tu as un petit soucis !
    Voici un petit cours très simple:
    http://www.generationphp.net/cours/concatenation/

    Utilise la concaténation pour passer d'une chaine de caractères à une variable ou une fonction :) pour cela, utilises le point !

    Au lieu de:
    echo ' 
    
    <html> 
    
     <head> 
      
      <title>'; $shwd_layout_nom echo '</title> 
      <link href="'; $url_root echo '/config/style.css" rel="stylesheet" title="Style" /> 
      
     </head> 
      
     <body> 
      
      <div id="page" bgcolor="'; $shwd_layout_fond echo '"> 
        
       <span id="header">'; 
    


    Tu dois avoir:
    echo ' 
    
    <html> 
    
     <head> 
      // On entoure la variable de points :)
      <title>' . $shwd_layout_nom . '</title> 
    // On fait de même ici, on entoure la variable de points !
      <link href="' . $url_root . '/config/style.css" rel="stylesheet" title="Style" /> 
      
     </head> 
      
     <body> 
      // Et encore ici !!
      <div id="page" bgcolor="' . $shwd_layout_fond . '"> 
        
       <span id="header">'; 
    

    => On a supprimé tes ECHO qui ne servaient à rien !

    Ne discutez jamais, vous ne convaincrez personne. Les opinions sont comme des clous ; plus on tape dessus, plus on les enfonce.
    0