Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Necesito pasar una variable desde smarty a php.

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Spanish
View previous topic :: View next topic  
Author Message
Santiagobg
Smarty n00b


Joined: 25 Jun 2014
Posts: 1

PostPosted: Wed Jun 25, 2014 5:56 pm    Post subject: Necesito pasar una variable desde smarty a php. Reply with quote

Necesito pasar una variable desde smarty {id_user} a una página php con un formulario o desde un botón.

La página php está alojada en otra parte.

¿Como se puede hacer esto?
Back to top
View user's profile Send private message
mostaza
Smarty n00b


Joined: 31 Aug 2014
Posts: 2

PostPosted: Sun Aug 31, 2014 5:26 pm    Post subject: no se mucho!! Reply with quote

Pues yo no se mucho de esto, por eso estoy aquí!

Shocked pero es difícil ayudarlo si no da una explicación mas clara.

a ver si he entendido bien,

usted tiene smarty corriendo en un directorio y una pagina php corriendo en otro lugar sin smarty ¿verdad?

si es asi lo que se me ocurre, como cosa rápida, es pasar la variable por get o post
y recibirla en el php, alago asi:

por get:

<a ref="http://su_pagina.php?variable={$id_user|intval}" > pagina usuario</a>

en la pagina php

recibe la variable:

$variable= (int)$_GET["valor"];

le encaje un int para que sea un entero si o si, usted puede validar como quiera, incluso puede utilizar un if y else por si no recibe nada.... Rolling Eyes

Por POST seria algo asi:

<form action="su_pagina.php" method=post>
<imput name="valor" type="hidden" value="{id_user|intval}">
<input type=submit value=enviar name="submit">
</form>

en la pagina php recibe:

$variable= (int)$_POST["valor"];

estem el formulario también se puede utilizar para enviar por get solo debe cambiar el method=get


saludos
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Spanish All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP