How does the PHP template and background make the drop-down box value unchanged after the button drop-down box?

Source: Internet
Author: User
Tags php template
Smarty Templates:

{{foreach from= $arr item=h key=i}}{{$h [0]}} {{/foreach}}
PHP page: if ($_post[' act ']== ") {//Enter page $SQL =" SELECT distinct stud_id from Stud_base "; $rs = $CONN->execute ($SQL) or Die ($SQL); $arr = $rs->getarray (); $smarty->assign ("arr", $arr); } if ($_post[' act ']== "inquiry") {//lookup button $y = $_post[' Cbo_grade ']; $smarty->assign ("arr", $y); Now I can do this in the button after the drop-down box or select the value, but it only appears the first character, the back of the not out, how to modify it? Or what better way to do it? Trouble Master to help, thank you. What does it mean to reply to a discussion (solution)? Describes the logical process in detail. The code is not affixed to the whole. {{$h [0]}} $smarty->assign ("Cbo_ Grade1 ", $_post[' cbo_grade1 ']); {{$h [0]}} $smarty->assign ("Cbo_ Grade1 ", $_post[' cbo_grade1 ']); Smarty seems to have not been transferred to AH? I changed the source of the group to $smarty->assign ("arr", $_post[' cbo_grade1 '); Press the Find button he only displays the first word .... Originally id= ' GB1234 ' is now transferred back only a G 、、、 I suddenly thought why only the first one came out {{foreach from= $arr item=h key=i}} {{$h [0]}}< /option> {{/foreach}}
Reason is < p="">

$h [i]

What is the format of your array? Prinr_r ($arr); Look

$_post[' Cbo_grade1 ');
I'm sure it's time to pass this value through {{foreach from= $arr item=h key=i}}
I split the value.A 1th value is displayed: How will $_post[' cbo_grade1 ');
Tied to a value that cannot be split, or how to change the drop box? Please answer the experts, thank you

Some of my arrays are all numbers and numbers and letters, a bit full of noon, I now have 3 drop-down boxes on the top of the Prinr_r ($arr); It seems to have been written wrong ... Print_r ($arr); Just right.

$_post[' cbo_grade1 ') equals the value you commit, which is a single value. Are you sure you can show all option?

I can't even get the value I chose $_post[' Cbo_grade1 ' back to the drop-down box. Also show all, I now think I choose the value of the drop-down box to click the button can also be the same, that is, the post value is passed back, do not let the drop-down box is empty on the line 、。。

Smarty specifically provides html_options template functions to solve the related operations of the list control
See http://www.php100.com/manual/smarty/language.function.html.options.html

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.