par
le_banban » 02 mars 2008, 16:13
bonjour
excusez moi pour le titre qui n'est pas tres clair, pas du tout meme.
Je vous explique mon soucis, je suis en train de mettre un système de vote pour mon site, je souhaite savoir si il est possible d'ajouter un echo dans un echo deja existant ?
exemple:
Code : Tout sélectionner
<?php require_once('../Connections/config.php'); ?>
<?php require('_drawrating.php'); ?>
<?php
$colname_view = "-1";
if (isset($_GET['view'])) {
$colname_view = (get_magic_quotes_gpc()) ? $_GET['view'] : addslashes($_GET['view']);
}
mysql_select_db($database_config, $config);
$query_view = sprintf("SELECT * FROM tutoriaux WHERE id = %s", $colname_view);
$view = mysql_query($query_view, $config) or die(mysql_error());
$row_view = mysql_fetch_assoc($view);
$totalRows_view = mysql_num_rows($view);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Document sans titre</title>
<script type="text/javascript" language="javascript" src="js/behavior.js"></script>
<script type="text/javascript" language="javascript" src="js/rating.js"></script>
<link rel="stylesheet" type="text/css" href="css/default.css" />
<link rel="stylesheet" type="text/css" href="css/rating.css" />
</head>
<body>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>id <?php echo $row_view['id']; ?></td>
<td>titre <?php echo $row_view['titre']; ?></td>
</tr>
<tr>
<td height="317"> </td>
<td><?php echo rating_bar('',''); ?></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($view);
?>
je voudrais avoir dans
<?php echo rating_bar('',''); ?>
<?php echo rating_bar('1',''); ?>
" 1 " qui sera ID de mon enregistrement, pour l'obtenir j'utilise
<?php echo rating_bar('$row_view['id']',''); ?>
Lorsque que test j'ai un sympatique petit message " Parse error: parse error....... "
avez vous une solution ?

bonjour
excusez moi pour le titre qui n'est pas tres clair, pas du tout meme.
Je vous explique mon soucis, je suis en train de mettre un système de vote pour mon site, je souhaite savoir si il est possible d'ajouter un echo dans un echo deja existant ?
exemple:
[code]<?php require_once('../Connections/config.php'); ?>
<?php require('_drawrating.php'); ?>
<?php
$colname_view = "-1";
if (isset($_GET['view'])) {
$colname_view = (get_magic_quotes_gpc()) ? $_GET['view'] : addslashes($_GET['view']);
}
mysql_select_db($database_config, $config);
$query_view = sprintf("SELECT * FROM tutoriaux WHERE id = %s", $colname_view);
$view = mysql_query($query_view, $config) or die(mysql_error());
$row_view = mysql_fetch_assoc($view);
$totalRows_view = mysql_num_rows($view);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Document sans titre</title>
<script type="text/javascript" language="javascript" src="js/behavior.js"></script>
<script type="text/javascript" language="javascript" src="js/rating.js"></script>
<link rel="stylesheet" type="text/css" href="css/default.css" />
<link rel="stylesheet" type="text/css" href="css/rating.css" />
</head>
<body>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>id <?php echo $row_view['id']; ?></td>
<td>titre <?php echo $row_view['titre']; ?></td>
</tr>
<tr>
<td height="317"> </td>
<td><?php echo rating_bar('',''); ?></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($view);
?>[/code]
je voudrais avoir dans [php]<?php echo rating_bar('',''); ?>[/php] [php]<?php echo rating_bar('1',''); ?>[/php] " 1 " qui sera ID de mon enregistrement, pour l'obtenir j'utilise [php]<?php echo rating_bar('$row_view['id']',''); ?>[/php]
Lorsque que test j'ai un sympatique petit message " Parse error: parse error....... "
avez vous une solution ? :oops: