English 中文(简体)
直接问题和固定问题
原标题:Redirect and set_select problem

I am using CodeIgniter 1.7.1.Ok here is the scenario.When ever the form is submitted,i need to do two things

1) persist the value selected in dropdown. 2) using session->set_flashdata(),i need to set the custom database message.

我们现在知道,我们必须在能够确定这一突发数据之前重新定位。

这是我撰写的法典。

if ($this->form_validation->run() == TRUE){

    $this->session->set_flashdata(‘msg’, ‘Taha Hasan’); 
    redirect(current_url());

    $this->ShowReceiveInventoryView();
}

另外,为了保持这一价值,采用从降温角度看待的固定公式。

<select name=“myselect”>
<option value=“one” <?php echo set_select(‘myselect’, ‘one’, TRUE); ?> >One</option>
<option value=“two” <?php echo set_select(‘myselect’, ‘two’); ?> >Two</option>
<option value=“three” <?php echo set_select(‘myselect’, ‘three’); ?> >Three</option>
</select>

现在的问题是...... 闪电似乎是BUT的,因为一是向上页传递的,倒塌的定点——失去电算价值! 缺省值出现在甄选中: 如果删除该法典中的直线,那么下降值是有预想的,但闪电数据并没有确定!

希望你们能够解决这一问题。

最佳回答

<代码>_select(>>只适用于_POST阵列的内容(如你发现的),但你的后向显然是GET的要求。

处理此事的适当办法是在主计长内部进行询问,将正在编辑的标本转达你的意见。 在你看来,如果存在或基于所通过物体,你就重新流行你的形式,或根据<代码>制定违约值。

让我们假设我们正在编辑一个产品,该产品有<条码>米塞卢(一个明文标明的外地)财产。 如果产品<代码>myselect参数的价值等于目前的<代码>option——如果是的话,我们将使用<代码>_selects(>第3参数确定违约。

<option value="one" <?php echo set_select( myslect ,  one , ((!$product) || !$this->input->post( myselect ) && $product->myselect ==  one  ? TRUE : FALSE); ?>One</option>

<option value="two" <?php echo set_select( myselect ,  two , (!$this->input->post( myselect ) && $product->myselect ==  two  ? TRUE : FALSE); ?>Two</option>
问题回答

暂无回答




相关问题
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 ...

热门标签