Phorum.ro
Your Avatar Welcome to Phorum.ro!
If you haven't registered yet, click here!
Attention Visitor:
You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
Du-te înapoi   Phorum.ro > Web Design & Web Development > Programare > PHP > PHP Smarty Templates

PHP Smarty Templates Discutii despre lucrul cu Smarty.

Răspunde
 
Thread Tools Moduri de afișare
Vechi 19.01.2008   #1
AlexRose13
8-Bit Member
 
Data înregistrării: 19.01.2008
Mesaje: 2
Rep Power: 5
AlexRose13 is on a distinguished road
Implicit smarty help

salut,

dupa exemplul Guestbook de pe siteul smarty incerc sa fac un dictionar (school project .. )
nu reusesc totusi sa editez cuvintele.

Cod PHP:
    function editCuvant($formvars) {

        
$_query sprintf(
            
"update dex_cuvinte set cuvant='%s', definitie='%s' where id='$id' ",
            
mysql_escape_string($formvars['cuvant']),
            
mysql_escape_string($formvars['definitie'])
     );
        
        return 
$this->sql->query($_query);
        
    } 
asta e functia care ar trebui sa imi modifice cuvantul
problema este ca nu modifica nimic.
daca inlocuiesc $id cu 5 de ex. e totul ok..
unde trebuie declarat $id ? ca sa mi-l vada in functie
AlexRose13 is offline   Reply With Quote
Sponsored Links
Vechi 20.01.2008   #2
marius39
32-Bit Member
 
Data înregistrării: 04.04.2006
Mesaje: 62
Rep Power: 6
marius39 is on a distinguished road
Implicit

Incearca
Cod PHP:
function editCuvant($formvars) {

        
$_query sprintf(
            
"update dex_cuvinte set cuvant='%s', definitie='%s' where id='".$id."' ",
            
mysql_escape_string($formvars['cuvant']),
            
mysql_escape_string($formvars['definitie'])
     );
        
        return 
$this->sql->query($_query);
        
    } 
desi nu stiu cum primesti variabila asta. banuiala mea e ca il obtii printr-un post...
cum nu stiu restul codului $id=$_POST['ceva'] ori $id=$_GET['ceva'] ori il ai deja declarat si trebuie sa-l pui ca variabila globala ( global $id; )

Last edited by marius39; 20.01.2008 at 02:32:49.
marius39 is offline   Reply With Quote
Vechi 20.01.2008   #3
AlexRose13
8-Bit Member
 
Data înregistrării: 19.01.2008
Mesaje: 2
Rep Power: 5
AlexRose13 is on a distinguished road
Implicit

asta e modelul de la care am plecat

smarty.net/sampleapp/sampleapp_p1.php

da.. prin $_GET ... ideea e ca nu stiu unde sa il declar ca sa mi-l vada in functia din clasa respectiva.
AlexRose13 is offline   Reply With Quote
Vechi 17.11.2009   #4
paul alexandru
16-Bit Member
 
Data înregistrării: 17.11.2009
Mesaje: 26
Rep Power: 3
paul alexandru is on a distinguished road
Implicit smarty template engine

Citat:
În prealabil postat de marius39 Vezi mesajul
Incearca
Cod PHP:
function editCuvant($formvars) {

        
$_query sprintf(
            
"update dex_cuvinte set cuvant='%s', definitie='%s' where id='".$id."' ",
            
mysql_escape_string($formvars['cuvant']),
            
mysql_escape_string($formvars['definitie'])
     );
        
        return 
$this->sql->query($_query);
        
    } 
desi nu stiu cum primesti variabila asta. banuiala mea e ca il obtii printr-un post...
cum nu stiu restul codului $id=$_POST['ceva'] ori $id=$_GET['ceva'] ori il ai deja declarat si trebuie sa-l pui ca variabila globala ( global $id; )


daca aveti intrebari despre smarty template engine nu ezitati sa ma intrebati

Last edited by Luxian; 18.11.2009 at 01:08:16. Motiv: fara spam! please!
paul alexandru is offline   Reply With Quote
Răspunde


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Moduri de afișare

Reguli de postare
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Pornit
emoticoanele sunt Pornit
Codul [IMG] este Pornit
Codul HTML este Oprit



Ora este GMT +3. Ora este acum 14:49:11.


Rulează cu: vBulletin Version 3.8.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Forum SEO by Zoints

XXXXXXXXXXXXXXXXXXX
Inactive Reminders By Icora Web Design