Pagina 1 din 1
Cum pot apela o functie in echo? [REZOLVAT]
Scris: Sâm Ian 10, 2009 9:29 pm
de vlivius1
Buna seara
Cum pot apela o functie in echo?
De exemplu
function test()
{
echo 'test';
}
echo'
.....
test();
.....
';
Se poate apela ?
Sau trebuie sa rup echo?
Scris: Sâm Ian 10, 2009 10:03 pm
de Birkoff
Scris: Sâm Ian 10, 2009 10:07 pm
de vlivius1
Scris: Sâm Ian 10, 2009 10:40 pm
de vlivius1
Greseala mea era ca puneam dupa test(); (punct si virgula).
Scris: Sâm Ian 10, 2009 10:47 pm
de vlivius1
Dupa ce am aflat care a fost gresela mea acum am urmatoarea problema , nu imi afiseaza in link-ul detalii, imi afiseaza in tabel.
function link_det ()
{
$cat = ( isset($_GET['cat'])) ? 'cat='.$_GET['cat'].'' : 'cat_s='.$_GET['cat_s'].'' ;
$row = ( isset($_GET['row'])) ? 'row='.$_GET['row'].'' : 'row_s='.$_GET['row_s'].'' ;
$s_cat = ( isset($_GET['s_cat'])) ? 's_cat='.$_GET['s_cat'].'' : 's_cat_s='.$_GET['s_cat_s'].'' ;
echo 'index.php?'.$cat.'&'.$row.'&'.$s_cat.'det=on';
}
......
echo'
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td width="150" height="100"><div align="center"><a href="'.$row_v_prod['poza'].'" rel="lightbox[]" title="'.$row_v_prod['produs'].'"><img src="'.$row_v_prod['poza'].'" width="100" alt="'.$row_v_prod['produs'].'" border="0" /></a></div></td>
<td height="100" class="title1"><div align="left">
<p>'.$row_v_prod['produs'].'</p>
<p class="text1"><em>'.$row_v_prod['descriere'].'</em></p>
</div></td>
</tr>
<tr>
<td width="150" height="20" class="text1"><div align="center"> <span class="title2">Pret - '.$row_v_prod['pret'].' lei </span></div></td>
<td height="20" class="text1"><div align="left"><a href="'.link_det().'">Detalii</a></div></td>
</tr>
<tr class="row_small">
<td height="20" colspan="2" class="text1" style="border-bottom:1px dashed #CCCCCC"> </td>
</tr>
</table>
';
}
......
Scris: Sâm Ian 10, 2009 11:07 pm
de Birkoff
in interiorul functiei link_det pune return in loc de echo si ar trebui sa iti mearga ok restul
Scris: Sâm Ian 10, 2009 11:22 pm
de vlivius1
Scris: Dum Ian 11, 2009 12:44 am
de vectorialpx