应该是“请问php如何得到smarty模版中表单提交的变量“
一着急打错了
一着急打错了
解决方案 »
- php中的箭头是什么意思啊
- phpmyadmin 搜索 与 查询 不同
- php读取文本文件
- php 文件下载
- 急!!!Call to a member function on a non-object 错误,哪位帮忙找找错哪了?急呀!!
- 网站全部用UTF-8编码。我需要注意什么?谢谢。
- 我有一项目,用php+mysql 谁还有php 做的 网站 的技术服务合同例子 !
- 我怎么才能知道web用的什么服务器啊?
- php的树结构怎么实现。。。。高分奉送。。。。。
- 如何提取string中的大量标签值?
- vhost_alias_module 配置虚拟主机的问题,100分
- 高手们,一个关于 Apache 的问题
$smarty->assign("name","value");才可以得到。
<{php}>session_start();<{/php}>
<html>
<head></head>
<body>
<form action=test1.php method=post>
<{html_select_date start_year='2002' end_year='2004' month_format='%d' field_order='YMD'}><input type=submit>
</form></body>
</html>====index.php====
<?php
session_start();//这个我不知道需不需要
define('SMARTY_DIR','/usr/local/www/Smarty/libs/');
require(SMARTY_DIR.'Smarty.class.php');
$smarty = new Smarty;$smarty->template_dir = '/usr/local/www/smartytest/templates/';
$smarty->compile_dir = '/usr/local/www/smartytest/templates_c/';
$smarty->config_dir = '/usr/local/www/smartytest/configs/';
$smarty->cache_dir = '/usr/local/www/smartytest/cache/';
$smarty->left_delimiter = '<{';
$smarty->right_delimiter = '}>';$smarty->debugging = true;$smarty->assign('name','snake');
$smarty->assign('da',$_POST['Date_year']);
var_dump($da);
$smarty->display('index.tpl');?>这样吗?请教...
其实无论是否用smarty,php从表单取值都是一样的啊
比如你表单中有<input type=text name=text1 id=text1 value="abc">
post之后,php中使用$_POST['text1']就能够得到对应的值了啊
smarty并非对php技术做了任何的修改,对php与client的交互没有任何影响的。