douge7771 2014-03-24 04:10
浏览 28

在新页面上显示php结果

I have seen examples and I have an idea of how to solve it, but the name on my checkbox I use uses concatenation. Because of this I do not know how to post the data on a new page using a name. I tried several ways and nothing so far. I need the data to posted on saveGames.php and I was then going to use a function to parse through the data and select the ones only with $id and checked (Example: "43checked")

UpcomingGames.php

<form name="saveGames" action="saveGames.php" method="post"> 

//Code

</form>


/*PHP function for setting up checkboxes for many different rows. I set up the name as $id which is the gameId and I added checkbox next to it so later I can parse through the data and select the ones with checked as the value because those games were selected. */

function checkbox($params)
{
  echo "<td>";
  $id = $params["gameID"];
  echo "<input id=\"$id\" type=\"checkbox\" name='". $id ."checkbox'>";
  echo "</td>";
}

Trying to post on this page saveGames.php

<?php include('header.php'); ?>


<?php

  require_once('dbBaseDao.php');
  require_once('dbUserDao.php');
  require_once('dbBotDao.php');

  $userDao = new dbUserDao();
  $botDao = new dbBotDao();

 $ChosenGame = $_POST["'. $id 'checked"];

 echo $ChosenGame;

?>
  • 写回答

1条回答 默认 最新

  • douyou1960 2014-03-24 07:30
    关注

    Do you really need the word checkbox in the name part of the input tag. If no then the problem is solved.

    If you want it then you have to find a method to pass the value stored in the variable $id to the next page. You could use a hidden input tag for that.

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据