Jump to content

Getting HTML out of DB


Bravat

Recommended Posts

I have stored a text into DB with HTML tag. Is it possible to read it from DB and display in browser as tagged? Exemple of text:

<p>
O nama<br />
Iza Online prodaje guma stoji grupa mladih ljudi čiji je cilj da Vam omogući da na &scaron;to jednostavniji način dođete do Vama potrebnih proizvoda. Za početak smo se odlučili za gume najpoznatijih svetskih proizvođača. U perspektivi nam je pro&scaron;irenje asortimana proizvoda na prateću opremu, auto-kozmetiku i sve ostalo &scaron;to ide uz va&scaron;eg metalnog ljubimca.</p>
<p>
&nbsp;</p>
<p>
&nbsp;</p>
<table cellpadding="2" cellspacing="2" width="100%">
<tbody>
	<tr>
		<td width="32%">
			Naziv firme:</td>
		<td width="68%">
			<img alt="" height="25" src="http://localhost/GumeOnline/image/data/petrovicLogo.jpg" width="194" /></td>
	</tr>
	<tr>
		<td>
			Poslovno sedi&scaron;te:</td>
		<td>
			Sutjeska 64, Pirot, Srbija</td>
	</tr>
	<tr>
		<td>
			Delatnost:</td>
		<td>
			Trgovina na malo posredstvom po&scaron;te ili preko interneta</td>
	</tr>
	<tr>
		<td>
			&Scaron;ifra delatnosti:</td>
		<td>
			4791</td>
	</tr>
	<tr>
		<td>
			Matični broj:</td>
		<td>
			62244089</td>
	</tr>
	<tr>
		<td>
			PIB:</td>
		<td>
			106760742</td>
	</tr>
	<tr>
		<td>
			Br. računa:</td>
		<td>
			INTESA 160-341869-50</td>
	</tr>
	<tr>
		<td>
			Web adresa:</td>
		<td>
			<a href="http://www.gumeonline.co.rs/">www.gumeonline.co.rs</a></td>
	</tr>
	<tr>
		<td>
			Kontakt telefon:</td>
		<td>
			0616860008</td>
	</tr>
	<tr>
		<td>
			Kontakt e-mail adresa:</td>
		<td>
			<a href="mailto:[email protected]">[email protected]</a><br />
			<a href="mailto:[email protected]">[email protected]</a></td>
	</tr>
</tbody>
</table>
<p>
&nbsp;</p>
<table cellpadding="2" cellspacing="2" width="100%">
</table>
<p>
Za sva pitanja i sugestije kontaktirajte nas putem mail-a na<br />
[email protected]</p>

Link to comment
https://forums.phpfreaks.com/topic/226877-getting-html-out-of-db/
Share on other sites

Do you know SQL? Do you know how to run a query to grab the contents of a table cell in a database?

 

I'm pretty sure that if you grab that code and display it on a html page, then it's not going to be written as HTML code, it's going to be written as normal text. That means, the web page will actually show HTML code..

 

Sounds very confusing, but for the browser to interpret that as HTML code, and therefore add styling for the paragraph element, then you need to store <p> in the database, and not <p>

 

Denno

This is interesting, I always thought the browser would render the page to make the table above but I cut and pasted the html in a file and looked at it in my browser and nothing happened (it looked the same).

 

Isn't this a bit like safe html, does the server format the code before sending it to the browser ?

 

I tried a space,   in the same page and it worked fine.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.