1,105,633 Community Members

How to echo html code in php echo

Member Avatar
logonchristy
Light Poster
42 posts since Apr 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 2 [?]
Skill Endorsements: 0 [?]
 
1
 
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...
Member Avatar
logonchristy
Light Poster
42 posts since Apr 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 2 [?]
Skill Endorsements: 0 [?]
 
0
 

Any one is there to help...

Member Avatar
hemgoyal_1990
Junior Poster
176 posts since Aug 2007
Reputation Points: 5 [?]
Q&As Helped to Solve: 17 [?]
Skill Endorsements: 0 [?]
 
0
 

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>";
?>
Member Avatar
network18
Practically a Master Poster
643 posts since Sep 2009
Reputation Points: 15 [?]
Q&As Helped to Solve: 78 [?]
Skill Endorsements: 0 [?]
 
0
 

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>"; 
?>
Member Avatar
yonker
Newbie Poster
13 posts since Oct 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 
<?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>"; ?>
Member Avatar
logonchristy
Light Poster
42 posts since Apr 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 2 [?]
Skill Endorsements: 0 [?]
 
0
 

hi frieds i solved it...

Question Answered as of 4 Years Ago by hemgoyal_1990, network18 and yonker
Member Avatar
Ine_1
Newbie Poster
1 post since Jan 2014
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

its solved? but where is the answer

Member Avatar
cereal
Posting Virtuoso
1,710 posts since Aug 2007
Reputation Points: 461 [?]
Q&As Helped to Solve: 345 [?]
Skill Endorsements: 44 [?]
 
0
 

@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:

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article