Jump to content

Limitare Caractere

Titi Grand

Recommended Posts

Cum pot limita caracterele si sa apara dupa ..... de ex: " Cine sunt eu? , Cine sun.... " acesta este codul

$sql = mysql_query('SELECT * FROM jocuri');
$sq2 = mysql_query('SELECT * FROM jocuri');
$totaliduri = mysql_num_rows($sql);
$totalfete = mysql_num_rows($sq2);
$rezultate_maxime_in_linie = 3;
$rezultate_maxime_in_jos = 7;
$result = mysql_query('SELECT * FROM jocuri');
$totale = mysql_num_rows($result);
if($totale == 0) echo '';
elseif(!isset($_GET['pagina'])) $pagina = 1;
else $pagina = $_GET['pagina'];
$cerereSQL = mysql_query('SELECT * FROM `jocuri` ORDER by `id` DESC LIMIT '.(($pagina * ($rezultate_maxime_in_jos*$rezultate_maxime_in_linie)) - ($rezultate_maxime_in_jos*$rezultate_maxime_in_linie)).', '.($rezultate_maxime_in_jos*$rezultate_maxime_in_linie).' ');
$pagini_totale = ceil($totale / ($rezultate_maxime_in_jos*$rezultate_maxime_in_linie));
if($pagina > $pagini_totale) header('location: index.php');
elseif($pagini_totale > 0) {
$seteaza = 0;
$numar = ($pagina - 1) * ($rezultate_maxime_in_jos*$rezultate_maxime_in_linie);
$culoare_celula = '#FFE0B3';
       echo '';
while($rand = mysql_fetch_array($cerereSQL)) {
if($seteaza == $rezultate_maxime_in_linie) {
echo "</tr><tr>n";
$seteaza = 1;
if($culoare_celula == "#FFE0B3")  $culoare_celula = "#FFFFFF";
else $culoare_celula = "#FFE0B3";
} else $seteaza++;
// prescurtare nume
$nume_1 = substr($rand['nume'],0,12);
echo '
     <div class="coloana">
               <ul class="lista-items">    <li>
<div> <a href="../joc.html?joaca='.$rand['joaca'].' ">
<img src="../upload/jocimg/'.$rand['linkpoza'].' "/></a></div>
 <a href="../joc.html?joaca='.$rand['joaca'].'  " title=" '.$rand['joaca'].' ">'.$rand['joaca'].'</a><br />
</span><br />                  </li>

Link to comment
Share on other sites

poti folosi proprietatea CSS text-overflow ce poate avea valorile clip sau ellipsis.



<style type="text/css">
div {
border:1px solid #000000;
<div style="text-overflow:clip;">Acest text nu incape in element</div>
<div style="text-overflow:ellipsis;">Acest text nu incape in element</div>


Pune asta intr-o pagina noua html si vezi diferenta.


Tutoriale xHtml, CSS, JavaScript, PHp, MySql, AutoCAD

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.