Pass a PHP variable in a link to a Modal box -
hi have html link modal box works perfectly, trying pass variable form in modal box, how ever link shows nothing happens once clicked.
here normal code:
<a href="#accsettings1" role="button" class="btn btn-small btn-primary hidden-tablet hidden-phone" data-toggle="modal" data-original-title=""> add </a>
here php code
echo "<a href=\"#accsettings1?ip_address={$ip_address}\" class='btn btn-small btn-primary hidden-tablet hidden-phone' data-toggle='modal' data-original-title=''>add</a>";
use normal code , add php when need php variable:
<a href="#accsettings1?ip_address=<?=$ip_address?>" role="button" class="btn btn-small btn-primary hidden-tablet hidden-phone" data-toggle="modal" data-original-title=""> add </a>
if it's application doesn't work - debug first.
use handwritten example exercise with. make work. , add dynamical part using php fill variable. after have verify if dynamical code produced same result static one. instead of hover have inspect page source , compare original code. find differences , correct them.
to me, such url #accsettings1?ip_address=value
looks quite unusual. ?ip_address=value#accsettings1
looks more familiar me. though not js pro, nor know app internals , urls intention
Comments
Post a Comment