majnoune
Invité n'ayant pas de compte PHPfrance
20 juin 2006, 11:57
pour les 2 fichiers :
include "connect.php";
include "config.php";
[/code] y'as pas de probleme
le probleme c'est que la valeur d ela variable donné a : play.php?id=$c[id]
n'est pas affecté : voila tt le fichier qui pointe vers play.php
[code]
<?php
include "connect.php";
include "config.php";
include "header.php";
$a = "select * from arab_categories where id = \"$id\"";
$b = mysql_query($a) or die(mysql_error());
$c = mysql_fetch_array($b);
?>
<SCRIPT LANGUAGE="JavaScript">
function popup(page) {
// ouvre une fenetre sans barre d'etat, ni de barre de scroll
window.open(page,'popup','width=600,height=600,menuBar=no location=no resizable=no toolbar=no,scrollbars=no');
}
</SCRIPT>
<table width="446" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="19" valign="middle" background="img/topbarfolder.gif"> <center>
<strong><font color="#FFFFFF"><a href=index.php><font color=white>Acceuil</font></a> » <a href=arabs.php><font color=white>Category</font></a> » <a href=arab_category.php?id=<?=$c[id]?>><font color=white><?=$c[name]?></font></a></font></strong> <br>
</center></td>
</tr>
<tr>
<td class=dott2><table width="446" border="0" cellspacing="2" cellpadding="2">
<?php
$filename = "category.php"; // name of this file
$option = array (5, 10, 25, 50, 100, 200);
$default = 10; // default number of records per page
$action = $_SERVER['PHP_SELF']; // if this doesn't work, enter the filename
$query = "SELECT * FROM arabs where c_id = $id AND valid = '1' order by c_id"; // database query. Enter your query here
// end config---------------------------------
$opt_cnt = count ($option);
$go = $_GET['go'];
// paranoid
if ($go == "") {
$go = $default;
}
elseif (!in_array ($go, $option)) {
$go = $default;
}
elseif (!is_numeric ($go)) {
$go = $default;
}
$nol = $go;
$limit = "0, $nol";
$count = 1;
$off_sql = mysql_query ("$query") or die ("Error in query: $off_sql".mysql_error());
$off_pag = ceil (mysql_num_rows($off_sql) / $nol);
//--------------------------------------------
$off = $_GET['offset'];
//paranoid
if (get_magic_quotes_gpc() == 0) {
$off = addslashes ($off);
}
if (!is_numeric ($off)) {
$off = 1;
}
// this checks if user is trying to put something stupid in query string
if ($off > $off_pag) {
$off = 1;
}
if ($off == "1") {
$limit = "0, $nol";
}
elseif ($off <> "") {
for ($i = 0; $i <= ($off - 1) * $nol; $i ++) {
$limit = "$i, $nol";
$count = $i + 1;
}
}
// Query to extract records from database.
$sql = mysql_query ("$query LIMIT $limit") or die ("Error in query: $sql".mysql_error());
$c[id]=$row->id;
while ($row = mysql_fetch_object($sql)) {
// EDIT ME. Edit the line below to match your own table. Just replace $row->url with $row->your_table_column
echo "
<tr>
<td colspan='3' bgcolor='ffcc22'><strong> »$row->name</strong></td>
</tr>
<tr>
<td colspan='1'><img src='funnypics/$row->link' width='100' height='110' align='top'></td>
<td colspan='2'>$row->description ..</td>
</tr>
<tr bgcolor='#FFFF99'>
<td width=33% align='center'>Added le : $row->addedon</td>
<td width=33% align='center'>[color=green]<a href='#' onClick=\"popup('play.php?id=$c[id]')\"><b>:. Play .:</b></a></td>[/color]
<td width=33% align='center'>Vues: $row->viewed Fois</td>
</tr>
"; // this is example, you may enter here anything you like
$count += 1;
}
echo "<br><center><font class=menu>";
if ($off <> 1) {
$prev = $off - 1;
echo "« <a href=\"$filename?id=$id&offset=$prev&go=$go\">Previous Page</a>\r\n";
}
for ($i = 1; $i <= $off_pag; $i ++) {
if ($i == $off) {
echo "( $i ) \r\n";
} else {
echo "[ <a href=\"$filename?id=$id&offset=$i&go=$go\">$i</a> ] \r\n";
}
}
if ($off < $off_pag) {
$next = $off + 1;
echo "<a href=\"$filename?id=$id&offset=$next&go=$go\">Next Page</a> »\r\n";
}
echo "<br /><br />\r\n";
?>
<?
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM arabs where c_id = $id AND valid = '1'"),0);
if($total_results == 0){
echo "<br><center><font class=menu><strong> Y'as pas encore d'images dans cette Categorie.</strong> <a href=add_arabs.php><br>Aidez nous en participant à l'évolution du site .</a></font><br><br>";
}
?>
</table>
</td>
</tr>
<tr>
<td><img src="img/bottombar.gif" width="448" height="18"></td>
</tr>
</table><br>
<?
include "footer.php";
?>