Page 1 of 1

Some help please, i don't get'it...

Posted: Mon Nov 24, 2003 6:32 pm
by liviu
I have the fallowing code:

Code: Select all

<?
include('config.inc.php');

$sql = "select * from anunt_imob_io order by id desc";
$sel = mysql_query($sql);

?>
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link rel="stylesheet" type="text/css" href="stil.php">
<title>New Page 1</title>
</head>

<body>
<script src="culoarebari.js"></script>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="700">
  <tr>
    <td width="149" rowspan="3" valign="top">
    <p align="center">
    <img border="0" src="img/imob.gif" width="100" height="66"></td>
    <td width="551" bgcolor="#E3EEF4">
    <p align="center"><b><font face="Verdana" size="2">IMOBILIARE ::</font><font face="Verdana" size="2" color="#004080"> 
    INCHIRIERI-OFERTE</font></b></td>
	</tr>
	<tr>
	<td align="center">
	<?
	$id = 0; 
	$list = "SELECT * FROM anunt_imob_io ORDER BY id DESC"; 
	$resursa = mysql_query($list); 
	$numar = mysql_num_rows($resursa);

	if(!isset($page))&#123; 
	$page=0;
	$curent = $_GET&#1111;'page'];
	$rest = $numar%$num_posts; 
	&#125;
	if($rest == "0")&#123;
	$pagini = $numar/$num_posts;
	&#125; 
	else 
	&#123;
	$pagini_dec = $numar/$num_posts; 
	$pagini_dec = explode(".",$pagini_dec); 
	$pagini = $pagini_dec&#1111;0]+1; 
	&#125; 
	if (($pagini*$num_posts) < $numar) &#123; 
	$pagini++; 
	&#125;

echo "<table align='center' width=100%> 
<tr> 
<td width=100% align=right> 
<font face='Verdana' size=2>"; 

print ' '.$lang_pgs.'';
for ($x = 1; $x <= $pagini; $x++)
&#123;
if($x == $curent) &#123;
print ''.$x.'';
print " ";
&#125; else &#123;
print '<a class="page_nr" href="imob_io.php?page='.$x.'">'.$x.'</a>';
print " ";
&#125;
&#125;	
print '</font></td></tr></table>';
	
	
	?>
	</td>
	</tr>
  <tr>
    <td width="551">
	<?
	while ($rez = mysql_fetch_array($sel)) &#123;
	$corp = $rez&#1111;'corp'];
	$corp1 = wordwrap($corp, 55, "\n", 1);
	$corp1 = preg_replace('#(<)(&#1111;\/]?.*?)(>)#is', "<\\2>", $corp1);
	
	$id++;
if ($id>($curent-1)*$num_posts)
	if ($id<=($curent*$num_posts))
	&#123;
	
	echo "
    <div align="center">
      <center>
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="551">
        <tr>
          <td width="500" colspan="2"><hr></td>
        </tr>
        <tr>
          <td width="500" colspan="2">
          <p align="left"><font face="Arial" size="2">Anunt afisat de
          <font color="#004080"><a href="mailto:".cenzura($rez&#1111;'email'])."?subject=In legatura cu anuntul dumneavoastra..." class="top">".cenzura($rez&#1111;'nume'])."&nbsp;".cenzura($rez&#1111;'prenume'])."</a></font> la data
          <font color="#004080"><b>".$rez&#1111;'zi_in'].".".$rez&#1111;'luna_in'].".".$rez&#1111;'an_in']."</b></font>. Expira la
          <font color="#004080"><b>".$rez&#1111;'zi_out'].".".$rez&#1111;'luna_out'].".".$rez&#1111;'an_out']."</b></font></font></td>
        </tr>
        <tr>
          <td width="69" align="center" valign="top" bgcolor="#004080">
          <p style="margin-top: 0; margin-bottom: 0">
          <font face="Arial" size="2" color="#ffffff">ID anunt</font></p>
          <p style="margin-top: 0; margin-bottom: 0"><b>
          <font face="Arial" size="2" color="#ffffff">".$rez&#1111;'anunt_id']."</font></b></td>
		  
          <td width="480" valign="top" bgcolor="#E3EEF4"><b>
          <font face="Verdana" size="2">".cenzura($corp1)."</font></b></td>
        </tr>
        <tr>
          <td width="71" align="center" valign="top">&nbsp;</td>
          <td width="480" valign="top">
          <p style="margin-top: 0; margin-bottom: 0">
          <font face="Arial" size="2">Relatii la telefon: <font color="#004080">
          <b>".cenzura($rez&#1111;'tel'])."</b> </font>sau la</font></p>
          <p style="margin-top: 0; margin-bottom: 0">
          <font face="Arial" size="2">adresa: <b><font color="#004080">".cenzura($rez&#1111;'adres'])."</font></b></font></td>
        </tr>
        <tr>
          <td width="551" align="center" valign="top" colspan="2"><hr></td>
        </tr>
      </table>
      </center>
    </div>";
	&#125;
	&#125;
	?>
    </td>
  </tr>
</table>

</body>

</html>
But it does'nt show anything ! Where is the problem ? The connections whit MySQL are ok.

Posted: Tue Nov 25, 2003 4:35 am
by bionicdonkey