How to echo html code in php echo not for email... 

<?php echo  '<a href="http://digg.com/submit?phase=2&amp;url='. $_POST["url"] .'&amp;title='.echo $_POST["title"].'" target="_blank"><img src="http://www.virtualdolphintherapy.com/images/digg.png" alt="Digg" width="64" height="63" border="0" /></a>'; ?>

how can i make this code to disply in browser page...
yonker commented: hi +0
Re: How to echo html code in php echo 80 80

Any one is there to help...

Re: How to echo html code in php echo 80 80

You may Use the Below Specified Code:

<?PHP
echo "<a href=\"http://digg.com/submit?phase=2&amp;url=".$_POST["url"]."&amp;title=".$_POST["title"]." target=\"_blank\"><img src=\"http://www.virtualdolphintherapy.com/images/digg.png\" alt=\"Digg\" width=\"64\" height=\"63\" border=\"0\"/></a>";
?>
Re: How to echo html code in php echo 80 80

try this -

<?php 
echo  "<a href='http:////digg.com//submit?phase=2&amp;url='$_POST['url']'&amp;title='$_POST['title']' target='_blank'><img src='http:////www.virtualdolphintherapy.com//images//digg.png' alt='Digg' width='64' height='63' border='0' //><//a>"; 
?>
Re: How to echo html code in php echo 80 80
<?php echo  "<a href='http:////digg.com//submit?phase=2&amp;url='$_POST['url']'&amp;title='$_POST['title']' target='_blank'><img src='http:////www.virtualdolphintherapy.com//images//digg.png' alt='Digg' width='64' height='63' border='0' //><//a>"; ?>
Re: How to echo html code in php echo 80 80

hi frieds i solved it...

Re: How to echo html code in php echo 80 80

its solved? but where is the answer

Re: How to echo html code in php echo 80 80

@Ine_1

Hello, in practice you have to escape the quotes of the html code. If you use double quotes then you can write:

echo "<span class=\"smile\">hello</span>";

Notice how the class quotes are escaped by the backslash \". This can be rewritten in many ways:

echo "<span class='smile'>hello</span>";
echo '<span class="smile">hello</span>';

# with simple variable
$class = 'smile';
echo "<span class='".$class."'>hello</span>";
echo "<span class='$class'>hello</span>";
echo '<span class="'.$class.'">hello</span>';

# with array
$class['span'] = 'smile';
echo "<span class='{$class['span']}'>hello</span>";
echo '<span class="'.$class['span'].'">hello</span>';

Documentation:

Re: How to echo html code in php echo 80 80

A better idea would be to use the HEREDOC method as its much neater

<?php
$url = trim($_POST['url']);
$title = trim($_POST["title"]);
echo  <<< THEHTML
<a href="http://digg.com/submit?phase=2&url=$url&title=$title" target="_blank"><img src="http://www.virtualdolphintherapy.com/images/digg.png" alt="Digg" width="64" height="63" border="0" /></a>;
THEHTML;
?>

Remember that HEREDOC stops parsing when it reads the original start word and must begin without and spaces. That is, THEHTML in the end must start without any tabs or indents for HEREDOC to work. Most people make this mistake and don't understand why their code never worked. Just a heads up!

commented: good one +13
Re: How to echo html code in php echo 80 80

yes , @timetraveller1992 is correct

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.