共有三页page1、page2和page3。当我在第1页的第一个表单上按submit时,我的组名字段可以在目标页面中用$\\u POST[\'groupname\')捕捉,但在第2页中,我有另一个表单,按下该表单时,应将$\\u POST[\'groupname]的值传递给第三页。在第三页上,我收到了组名值,但空格后的字符被截断。就像我把印度队长作为组名,所以我只能收到“队长”。知道如何解决这个问题吗。下面是我的代码。
表格1(见第2页$\\u POST[\'groupname\'])
add_shortcode(\'groupdetails\',\'groupdetails\');
function groupdetails()
{
if(isset($_POST[\'Details\']))
{
//max participants check start here
global $form;
global $wpdb;
//max participants check ends here
echo \'<form id="joinform" action="http://localhost:7777/wordpress/insert/" method="post">\';
echo "<input name=\'gid\' type=\'hidden\' value=".$_POST[\'gid\'].">";
echo "<input name=\'mygroup\' type=\'hidden\' value=".$_POST[\'groupname\'].">";
echo "Id : ".$_POST[\'gid\']."<br>";
echo "Group Name : ".$_POST[\'groupname\']."<br>";
echo "Group Type : ".$_POST[\'groupstype\']."<br>";
echo "Leader Name : ".$_POST[\'lfirstname\']."<br>";
echo "Address : ".$_POST[\'address\']."<br>";
echo "City : ".$_POST[\'city\']."<br>";
echo "State : ".$_POST[\'state\']."<br>";
echo "Zip : ".$_POST[\'zipicode\']."<br>";
echo "Meeting Days : ".$_POST[\'meetingdays\']."<br>";
echo "Meeting Time : ".$_POST[\'meetingtime\']."<br>";
echo "Max Participants : ".$_POST[\'maxparticipants\']."<br>";
echo "Children : ".$_POST[\'children\']."<br>";
echo "Description : ".$_POST[\'Description\']."<br>";
echo \'<input name="Join" type="submit" value="Join" />\';
echo \'</form>\';
}
}
page3(在上一个表单上按submit后,mygroup name变量在该页面上的第一个空格后插入)
add_shortcode(\'insertform\',\'insertform\');
function insertform()
{
ob_start();
global $wpdb;
global $form;
global $mygroup;
$mygroup = $_POST[\'mygroup\'];
echo $mygroup; //mygroup name value is truncated
}