Jump to content

Inserting HTML into a database?


spires

Recommended Posts

Hi

 

I'm trying to upload HTML into my database.

 

I'm using:

$description=addslashes($_POST['description']);

 

However, when i use HTML inside the content that i'm uploading,

the code gets all messed up, when viewing the code inside the

textarea?

 

I'm trying to build an EDIT section, But the code i want to edit

is not user friendly?

 

Heres the code i'm using to display the content

$desc2 = stripslashes(nl2br($row2['ptxt_body']));
<textarea name="description" cols="40" rows="7" wrap="PHYSICAL" id="description" value="'.$desc2.'" align="left">'.strip_tags($desc2, '<b><br /><i>').'</textarea>

 

Heres the link:

http://www.telegraphlondon.co.uk/text_upload.php

 

I want it to display this inside the text area.

hello world

<a href="index.php" class="bluelink">Email here</a>

 

And, i want it the display this when echoed to the screen.

hello world

 

Email here

 

(Email here becoming a blue Email link)

 

Any idears please

 

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/52187-inserting-html-into-a-database/
Share on other sites

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.