English 中文(简体)
表格
原标题:Post XML value with form

我把XPath搜索器并入了我的现场,当时,用户的搜索结果以及每个用户的检查箱都以下列方式显示。

<form action="saveProcess.php" method="POST">
            <?php
            foreach ($holidays as $holiday) 
            {
                $resultTable .=  "<p><a href="{$holiday->link}">{$holiday->title}</a>" . "<br/>" . 
                "{$holiday->pubDate}" . "<br>" . 
                "{$holiday->description}" . 
                "<input type= checkbox  name= chk[]  value= {$holiday->title}  />" . "<br /></p>";              
            }
            ?>
            <input type="submit"  name="btnOutput" value="submit"/>
        </form>

当一个检查箱被点击时,提交文件纽特被点击,希望<代码>{$holiday-> entitled}被贴在saveProcess.php上,并重复。 i 目前,有以下错误:<代码>。 通知:不明确的索引:储蓄收益的千兆克

<?php
    $title = $_POST[ chk ]
    echo $title;
?>

原因何在? 或许可以是,XML档案不能在储蓄程序内公布。 实验室档案或是否有一氧化氮错误一米没有发现?

成就

最佳回答

似乎不喜欢选择任何东西。 你们需要使用:

<?php
   $resultTable =   ;
   foreach ($holidays as $holiday) 
   {
      $resultTable .=  "<p><a href="{$holiday->link}">{$holiday->title}</a>" . "<br/>" . "{$holiday->pubDate}" . "<br>" . "{$holiday->description}" . "<input type= checkbox  name= chk[]  value= {$holiday->title}  />" . "<br /></p>";              
   }
   echo $resultTable;
?>

由于贵要素在名称结尾处有<代码>[],这表明你希望其作为阵列的一部分的_POST值。 它将在公共卫生和社会福利部中看到这一点:

array(0 =>  First value , 1 =>  Second value , 2 =>  Third value)

如果你需要单独处理每个价值:

foreach($_POST[ chk ] as $check_value)
{
   // process $check_value
}
问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签