Cum pot apela o functie in echo? [REZOLVAT]

Secţiune dedicată începatorilor.

Moderatori: Moderatori, Start Moderator

vlivius1
Senior Member
Mesaje: 399
Membru din: Dum Aug 12, 2007 3:50 pm
Localitate: Bucuresti
Contact:

Cum pot apela o functie in echo? [REZOLVAT]

Mesajde vlivius1 » Sâm Ian 10, 2009 9:29 pm

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?
Ultima oară modificat Sâm Ian 10, 2009 11:23 pm de către vlivius1, modificat 1 dată în total.



Avatar utilizator
Birkoff
Senior Member
Mesaje: 6380
Membru din: Joi Mar 18, 2004 2:34 pm
Localitate: Bucuresti
Contact:

Mesajde Birkoff » Sâm Ian 10, 2009 10:03 pm

1) )
2)
3) (open source)
4) Vrei un magazin virtual la cheie, usor de folosit, cu api-uri incluse pentru maximizarea vanzarilor si multe alte facilitati? Da un semn si discutam.

vlivius1
Senior Member
Mesaje: 399
Membru din: Dum Aug 12, 2007 3:50 pm
Localitate: Bucuresti
Contact:

Mesajde vlivius1 » Sâm Ian 10, 2009 10:07 pm


vlivius1
Senior Member
Mesaje: 399
Membru din: Dum Aug 12, 2007 3:50 pm
Localitate: Bucuresti
Contact:

Mesajde vlivius1 » Sâm Ian 10, 2009 10:40 pm

Greseala mea era ca puneam dupa test(); (punct si virgula).

vlivius1
Senior Member
Mesaje: 399
Membru din: Dum Aug 12, 2007 3:50 pm
Localitate: Bucuresti
Contact:

Mesajde vlivius1 » Sâm Ian 10, 2009 10:47 pm

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">&nbsp;<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">&nbsp;</td>
</tr>
</table>
';
}


......

Avatar utilizator
Birkoff
Senior Member
Mesaje: 6380
Membru din: Joi Mar 18, 2004 2:34 pm
Localitate: Bucuresti
Contact:

Mesajde Birkoff » Sâm Ian 10, 2009 11:07 pm

in interiorul functiei link_det pune return in loc de echo si ar trebui sa iti mearga ok restul
1) )
2)
3) (open source)
4) Vrei un magazin virtual la cheie, usor de folosit, cu api-uri incluse pentru maximizarea vanzarilor si multe alte facilitati? Da un semn si discutam.

vlivius1
Senior Member
Mesaje: 399
Membru din: Dum Aug 12, 2007 3:50 pm
Localitate: Bucuresti
Contact:

Mesajde vlivius1 » Sâm Ian 10, 2009 11:22 pm

:salute:

Avatar utilizator
vectorialpx
Senior Member
Mesaje: 4832
Membru din: Mar Mar 01, 2005 9:48 am
Localitate: Bucuresti
Contact:

Mesajde vectorialpx » Dum Ian 11, 2009 12:44 am



Înapoi la “PHP Incepători”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 59 vizitatori