What is it? [ulisting] in html page and $listing in php page. Is it related? -
i faced project. saw html page, of code below:
<div class="span6"> <div class="control-group"> <label class="col-wrap control-label" for="username">user id</label> <div class="col-wrap controls"> <select name="username" id="username" class="span12"> [ulisting] </select> <br><div id="show_hide" class="show_hide"><font color="red">user id exist</font></div> </div>
and found in php file:
$ulisting =""; $url = 'http://'.$_session["url"].'/-/vo/public/user.api_userlist?sess='.$_session["sessid"].'&format=json'; $content1 = file_get_contents($url); $json = json_decode($content1, true); foreach($json['user'] $item) { $name=$item['name']; $ulisting=$ulisting. "<option value=\"$name\">$name</option>"; }
after analysed code, thought related. can explain me it? keywords find article this? want larn how works.. give thanks you..
you find looks this
$template=str_replace('[ulisting]',$ulisting,$template); //or diff way replace
that [ulisting]
marker programmer set there using php can replace actual values select field later on. if not done, means nil special , should display in html is.
if replacement there, add together alternative values select box , there wont text [ulisting]
in final output html.
php
No comments:
Post a Comment