doushu5805 2013-09-26 19:25
浏览 96
已采纳

使用复选框将信息传递给下一个表单

I run a query

$querymail=mysql_query
("select sp.player_num as Pnum,concat(sp.first_name,' ',sp.last_name)as PName,
st.name as Team, sp.email_address as Email,spt_league_id as League, ss.Season_name
as Season from stats_player sp inner join stats_player_team stp,
stats_team st, stats_season ss 
where stp.player_num = sp.player_num and sp.email_address<>''
and st.team_num=stp.team_id and ss.season_index=stp.season_id and
ss.season_index=$this_season  order by st.name;");

and then output to a forum/table that has check boxes.

echo "<table border='1'>";
while($row=mysql_fetch_array($querymail))
{

echo "<tr><td><input type='checkbox' name='checkemail'
value=".$row'Pnum']."checked></td><td>".$row['PName']."</td><td>".$row['Email'].
"</td><td>".$row['Team'].' ' .$row['League'].' '.$row['Season']."</td></tr>";


}
echo "</table>";
echo "</form>";
}

It then send that info to a nother page to display info and then send to email addresses selected.

My query is good and the table displays correctly. I am unsure if I am actually gathering the correct information though via the check boxes. and that is where I need some help.

I want to collect sp.player_num of each checked item and pass to the next page. I will then do a lookup of the player num and email and set a email routine for that. but I can't seem to get anything to pass to next page.

I do a print_r($_POST) in emailall.ph but it returns empty.

Will I need to use Session_Start in this case?

  • 写回答

1条回答 默认 最新

  • dongpiao0731 2013-09-26 19:30
    关注

    You need to have a opening form tag.

    echo "<form method='post' action='emailall.php'>";
    

    You need to make the checkbox an array, note the [] which was added to the name field.

    echo "<tr><td><input type='checkbox' name='checkemail[]'
    value='".$row['Pnum']."' checked></td><td>".$row['PName']."</td><td>".$row['Email'].
    "</td><td>".$row['Team'].' ' .$row['League'].' '.$row['Season']."</td></tr>";
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据