[英]printing in joomla
我需要幫助來解決打印問題,這完全阻塞了我的項目。 確切地說,我有兩篇包含PHP代碼的Joomla文章(我使用的是Free Sourcerer插件)。
{source}
<form method="post" action="http://localhost/essai/index.php?option=com_content&view=article&id=2">
<p>
<input type="text" name="num" />
</p>
<input type="submit" value="Display the value of num" />
</form>
{/source}
{sourcer}
if (isset ($_POST [ 'num'])) {
$Address=J Request :: getVar( 'num', '', 'post');
echo $Address;
} else {
echo "num does not exist";
}
{/source}
我的目標是在ID為2的第二篇文章中恢復num形式的輸入字段的值並打印。 當我單擊按鈕“顯示num的值”時,將檢索並顯示值區域num
,但是當我單擊鏈接以打印文章時,打開的窗口中將顯示“不存在num”。 當我打印文章時, $ _POST ['num']
不存在!
這是在Joomla或其他打印機中打印的問題嗎? 請幫幫我。
注意 :我使用Joomla_2.5.9,集成在joomla中的Template Beez2,無Sourcerer v4.1.3
為了使此功能生效,您需要進行2個更改。
{source}
<?php
echo'<form method="post" action="http://localhost/essai/index.php?option=com_content&view=article&id=2">' .
'<p>' .
'<input type="text" name="num" />' .
'</p>' .
'<input type="submit" value="Display the value of num" />' .
'</form>';
?>
{/source}
{source}
<?php
if (isset($_POST['num'])) {
$Address=JRequest :: getVar('num','','post');
echo $Address;
} else {
echo "num does not exist";
}
?>
{/source}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.