0

I get string from database dynamically within my website, that contains fully HTML code,I need to show this string html to new browser window, suggest me how to do this.

<html>
..............
..............
<a href="#">link</a> (when click link it render value from db that contains whole html page, I am already in html page, how to show this extra html page)
..............
..............
</html>

note: I know echo command used to display html element to browser but my case is different. for example already I have body tag and write css, js, jquery for body tag, when I render html string from db, then used echo, it will add one more body tag to my website, so its get conflict with old one.

Rajkumar .E
  • 1,440
  • 3
  • 20
  • 34

2 Answers2

-1

you can store value in any variable and use echo function

Sanya Zahid
  • 466
  • 6
  • 18
-1

To open your page in a new window, use target="_blank" in your link declaration. This will open your link in a new window or new tab depending on your browser.

i.e.

<!DOCTYPE html>
<html>
<body>

<a href="new page url" target="_blank">Link to new window</a> 

</body>
</html>
  • I have no url, only php string variable contain html (its not a file, only variable) – Rajkumar .E Apr 29 '16 at 04:37
  • If you have the url in a php variable you could do something like this to append the variable to your html line.: `Link to new window"; ?>` – almostcolin Apr 29 '16 at 04:41
  • Sorry, I misunderstood the question. Check this [link](http://stackoverflow.com/questions/9399354/how-to-open-a-new-window-and-insert-html-into-it-using-jquery) to see how to open a new window and insert html using jQuery. – almostcolin Apr 29 '16 at 04:49