我想下面的代码添加到我的表单的动作部分之外:添加PHP代码到一个表单动作打印数据的形式
action="'.the_permalink().'?filename.php=1"
但这只会增加?filename.php=1
到表单的动作和the_permalink( )结果在表格甚至开始之前打印在表格之外!
这是我的表格行:
form name="front_end_aa" method="POST" action="".the_premalink()."?assign-journalist=1"
the_permalink()
是WordPress的内部的功能,让你在点击后的链接。
解决:这是解决由于@enenen:
Store中的PHP的结果到一个变量,变量追加到表单的动作是这样的:
$permalink = get_permalink();
echo '<form name="front_end_aa" method="POST" action="'.$permalink.'?filename=1">
你是指自己:HTTP:/ /codex.wordpress.org/Function_Reference/the_permalink?你在一个WordPress循环? –
您可以提供'action = ...'整个行以及'the_permalink()'函数的代码。 – enenen
@enenen当然检查我的原始问题 – Matt