Display php tag on browser instead of php value

hi i am new to php

i have used drop down and bind the data from database

in dropdown value display the php tag on browser

eg

title?>
desc?>

Welcome to the SP forums.

Could you post some code please?

below code for connectivity

it works fine in server but in localhost
<?php
//$dbservertype=‘mysql’;
$servername=‘localhost’;

$dbusername=“root”;

$dbpassword=“root”;

$dbname=“tesjoomlaautogua”;

connecttodb($servername,$dbname,$dbusername,$dbpassword);

function connecttodb($servername,$dbname,$dbuser,$dbpassword)
{
global $link;
$link=mysql_connect (“$servername”,“$dbuser”,“$dbpassword”);
if(!$link){die(“Could not connect to MySQL”);}
mysql_select_db(“$dbname”,$link) or die (“could not open db”.mysql_error());
}

session_start();
?>

below code is binding data in database

distributor.php

<?php
include(‘admin/includes/db.php’);
?>
<style>
.styled-select {
width: 220px;
overflow: hidden;
background: #ddd;
}
</style>
<link rel=“stylesheet” href=“dropdown.css” type=“text/css” />
<style media=“all” type=“text/css”>@import “menu_style.css”;</style>

<link href=“css/netcom.css” rel=“stylesheet” type=“text/css”>

<script type=“text/javascript”>
// <![CDATA[
function showDiv(obj){
if(document.getElementById){
divs=document.getElementById(“cont”).getElementsByTagName(“DIV”);
num=obj.options[obj.selectedIndex].value - 1;
for(i=0;i<divs.length;i++){
if (divs[i].className==“txt”){
if(i==num){
divs[i].style.display = “block”;
}else{
divs[i].style.display = “none”;
}
}
}
}
}
// ]]>
</script>

<table width=“391” border=“0” align=“center” cellpadding=“0” cellspacing=“0”>
<tr>
<td width=“7”> </td>
<td width=“383” class=“text-black”><div align=“center”></div></td>
</tr>

		  &lt;tr&gt;
            &lt;td&gt;&nbsp;&lt;/td&gt;
            &lt;td align="left"&gt;&lt;table border="0" cellspacing="0" cellpadding="0"&gt;
              &lt;tr&gt;
                &lt;td width="186" &gt;&lt;form action="" id="form1"&gt;
&lt;div style="text-align: center;" &gt;
	&lt;select id="select1" onchange="showDiv(this.form.select1)"  class="styled-select" &gt;

<?php $sel_admin_user=“select * from news1 order by id ASC”;

   $query_exe=mysql_query($sel_admin_user);
   $loop=1;
   while($res_query=mysql_fetch_object($query_exe))
   {
   ?&gt;
	 &lt;option value="&lt;?php=$loop; ?&gt;"&gt;&lt;?php=$res_query-&gt;title; ?&gt;&lt;/option&gt;
	&lt;?php $loop++; }
	?&gt;

	 &lt;/select&gt; &lt;br&gt;
&lt;/div&gt;

</form></td>
</tr>
</table>
<script type=“text/javascript”>

var thetext1=new Array()
thetext1[0]=“”
thetext1[1]=“”
thetext1[2]=“”
thetext1[3]=“news1.com- The #1 technology news1 site.”
thetext1[4]=“Web Coding and development forums”
var thetext2=new Array()
thetext2[0]=“CNN- US and World news1.”
thetext2[1]=“MSNBC- NBC news1 online.”
thetext2[2]=“BBC news1- Updated every minute of every day.”
thetext2[3]=“TheRegister- Daily IT news1.”

// Now, see 2) below for final customization step

function displaydesc(which, descriptionarray, container){
if (document.getElementById)
document.getElementById(container).innerHTML=descriptionarray[which.selectedIndex]
}

function jumptolink(what){
var selectedopt=what.options[what.selectedIndex]
if (document.getElementById && selectedopt.getAttribute(“target”)==“newwin”)
window.open(selectedopt.value)
else
window.location=selectedopt.value
}

displaydesc(document.form1.select1, thetext1, ‘textcontainer1’)
displaydesc(document.form2.select2, thetext2, ‘textcontainer2’)

</script></td>
</tr>
<tr>
<td> </td>
<td align=“left”>

			&lt;div id="cont"&gt;
&lt;div class="txt" style="display: block;"&gt;
			    &lt;?php
				
				$sel_admin_user="select * from news1 order by id ASC limit 0,1";

   $query_exe=mysql_query($sel_admin_user);
   $loop=1;
   while($res_query=mysql_fetch_object($query_exe))
   {
   ?&gt;
			&lt;span class="text-black"&gt;
			&lt;?php=$res_query-&gt;desc; ?&gt;
			&lt;/span&gt;
			&lt;?php } ?&gt;
				&lt;/div&gt;
				    &lt;?php
				
				$sel_admin_user="select * from news1 order by id ASC limit 1,100";

   $query_exe=mysql_query($sel_admin_user);
   $loop=1;
   while($res_query=mysql_fetch_object($query_exe))
   {
   ?&gt;
				&lt;div class="txt" style="display: none;"&gt;
				
				&lt;span class="text-black"&gt;
				
				
			&lt;span class="text-black"&gt;
			&lt;?php=$res_query-&gt;desc;?&gt;
			&lt;/span&gt;
			
				&lt;/span&gt;
				
				&lt;/div&gt;
				&lt;?php } ?&gt;
				
				
				&lt;/div&gt;
				&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/table&gt;
<?php=$res_query->title; ?>

You’re mixing shorthand and “full” code here. The shorthand version is

<?=$res_query->title; ?>

while the full version is

<?php echo $res_query->title; ?>

ya you are right but short hand code is not working on localhost what to do.

Don’t use it.

k sir
thank u so much sir