How to add html tags in a php -
i'm new php. not know how use expressions. here php code search file of site. want add html tags such href, div, li, ul, etc. how it?
if(mysqli_num_rows($results) >= 1) { $output = ""; while($row = mysqli_fetch_array($results)) { $output .= "size: " . $row['fh_vsize']. "<br />"; $output .= "icon: <img src=" . $path .$row['fh_sicon']. " alt=><br />"; $output .= "file id: " . str_replace("_"," ",$row['fh_sid']) . ""; $nbsp; $nbsp; $output .= "" . $row['fh_vcaption'] . "<br />"; $output .= "description: " . substr(strip_tags($row['fh_sdescription']),0,150) . "<br />"; $output .= "download: <a href=download_" . $row['fh_sid'] . "/>download</a><br /><br />"; } echo $output; } else echo "there no matching record name " . $searchlink;
something this. i'm sorry code. i'm new here , learn basics:
<div class="info"> <h4><a href="'. $path .'download_'. en_string($rec['fh_sid']) .'/">'.de_string($rec['fh_sid']) .' ' .$rec['fh_vcaption'] .' '. $rec['fh_vextension']. '</a><span class="updated">updated</span></h4> <div><img style="float:left;margin-right:5px" src="'. $path . str_replace("t_", "",$rec['fh_sicon'] ).'"/></div><p>'. substr (strip_tags($rec['fh_sdescription']),0,170) .' ...</p> <ul class="prod-info"> <li class="none-separator">last update: <strong>' . strftime("%d %b %y", $rec['fh_vdate']) . '</strong></li> <li>license: <a href="freeware_pop.html" title="'. $rec['fh_vlicense'] . '">'. $rec['fh_vlicense'] . '</a></li> <li>size: <strong>'.$rec['fh_vsize'].'</strong></li> <li>downloads: <strong>'. $views[$sid] .'</strong></li> <li><img src="../../images/dl.png"/> <a href="'.$path.'download_'.$rec['fh_sid'].'/">download</a></li> </ul> </div>
i sorry not full code can use this
while ($line1 = mysqli_fetch_object($result2)) { $i=0; $id = $line1->$index; // fetching whole object id of sql table foreach ($line1 $value1) { list($idname,$ext) = explode(".",$value1); if ($i==1) // show icon name { echo ' <li id='.$value1.' name="'.$id.'"> <form id="addchart'.$idname.'" action="addchart.php" target = "_self" method="post"> <a id='.$idname.' onmousedown = "addordelete(this.id,this.value)" href = "#" value='.$idname.'> <img id="picture" class="icon" src="images/item/php.png" width="70" style="margin: 0px 0px 0px 0px"/> <input type="hidden" name="db" value="'.$db.'" /> <input type="hidden" name="table" value="'.$table.'" /> <input type="hidden" name="id" value="'.$id.'" />
you echo 'html code , attribute here'
careful of syntax assign value, name or id if want assign value, name or id predefined php variable have made.
Comments
Post a Comment